1263508Sdim//===--- LangOptions.def - Language option database -------------*- C++ -*-===//
2226586Sdim//
3226586Sdim//                     The LLVM Compiler Infrastructure
4226586Sdim//
5226586Sdim// This file is distributed under the University of Illinois Open Source
6226586Sdim// License. See LICENSE.TXT for details.
7226586Sdim//
8226586Sdim//===----------------------------------------------------------------------===//
9226586Sdim//
10226586Sdim// This file defines the language options. Users of this file must
11263508Sdim// define the LANGOPT macro to make use of this information.
12226586Sdim// Optionally, the user may also define BENIGN_LANGOPT
13226586Sdim// (for options that don't affect the construction of the AST in an
14226586Sdim// incompatible way), ENUM_LANGOPT (for options that have enumeration,
15226586Sdim// rather than unsigned, type), BENIGN_ENUM_LANGOPT (for benign
16226586Sdim// options that have enumeration type), and VALUE_LANGOPT is a language option
17226586Sdim// that describes a value rather than a flag.
18226586Sdim//
19226586Sdim//===----------------------------------------------------------------------===//
20226586Sdim#ifndef LANGOPT
21226586Sdim#  error Define the LANGOPT macro to handle language options
22226586Sdim#endif
23226586Sdim
24226586Sdim#ifndef VALUE_LANGOPT
25226586Sdim#  define VALUE_LANGOPT(Name, Bits, Default, Description) \
26226586Sdim     LANGOPT(Name, Bits, Default, Description)
27226586Sdim#endif
28226586Sdim
29226586Sdim#ifndef BENIGN_LANGOPT
30226586Sdim#  define BENIGN_LANGOPT(Name, Bits, Default, Description) \
31226586Sdim     LANGOPT(Name, Bits, Default, Description)
32226586Sdim#endif
33226586Sdim
34226586Sdim#ifndef ENUM_LANGOPT
35226586Sdim#  define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
36226586Sdim     LANGOPT(Name, Bits, Default, Description)
37226586Sdim#endif
38226586Sdim
39226586Sdim#ifndef BENIGN_ENUM_LANGOPT
40226586Sdim#  define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
41226586Sdim     ENUM_LANGOPT(Name, Type, Bits, Default, Description)
42226586Sdim#endif
43226586Sdim
44226586SdimLANGOPT(C99               , 1, 0, "C99")
45234353SdimLANGOPT(C11               , 1, 0, "C11")
46226586SdimLANGOPT(MicrosoftExt      , 1, 0, "Microsoft extensions")
47226586SdimLANGOPT(MicrosoftMode     , 1, 0, "Microsoft compatibility mode")
48249423SdimLANGOPT(AsmBlocks         , 1, 0, "Microsoft inline asm blocks")
49226586SdimLANGOPT(Borland           , 1, 0, "Borland extensions")
50226586SdimLANGOPT(CPlusPlus         , 1, 0, "C++")
51249423SdimLANGOPT(CPlusPlus11       , 1, 0, "C++0x")
52243830SdimLANGOPT(CPlusPlus1y       , 1, 0, "C++1y")
53226586SdimLANGOPT(ObjC1             , 1, 0, "Objective-C 1")
54226586SdimLANGOPT(ObjC2             , 1, 0, "Objective-C 2")
55263508SdimBENIGN_LANGOPT(ObjCDefaultSynthProperties , 1, 0,
56226586Sdim               "Objective-C auto-synthesized properties")
57263508SdimBENIGN_LANGOPT(EncodeExtendedBlockSig , 1, 0,
58243830Sdim               "Encoding extended block type signature")
59263508SdimBENIGN_LANGOPT(ObjCInferRelatedResultType , 1, 1,
60226586Sdim               "Objective-C related result type inference")
61226586SdimLANGOPT(Trigraphs         , 1, 0,"trigraphs")
62243830SdimLANGOPT(LineComment       , 1, 0, "'//' comments")
63226586SdimLANGOPT(Bool              , 1, 0, "bool, true, and false keywords")
64243830SdimLANGOPT(WChar             , 1, CPlusPlus, "wchar_t keyword")
65226586SdimBENIGN_LANGOPT(DollarIdents   , 1, 1, "'$' in identifiers")
66226586SdimBENIGN_LANGOPT(AsmPreprocessor, 1, 0, "preprocessor in asm mode")
67226586SdimBENIGN_LANGOPT(GNUMode        , 1, 1, "GNU extensions")
68226586SdimLANGOPT(GNUKeywords       , 1, 1, "GNU keywords")
69226586SdimBENIGN_LANGOPT(ImplicitInt, 1, !C99 && !CPlusPlus, "C89 implicit 'int'")
70226586SdimLANGOPT(Digraphs          , 1, 0, "digraphs")
71226586SdimBENIGN_LANGOPT(HexFloats  , 1, C99, "C99 hexadecimal float constants")
72226586SdimLANGOPT(CXXOperatorNames  , 1, 0, "C++ operator name keywords")
73226586SdimLANGOPT(AppleKext         , 1, 0, "Apple kext support")
74226586SdimBENIGN_LANGOPT(PascalStrings, 1, 0, "Pascal string support")
75226586SdimLANGOPT(WritableStrings   , 1, 0, "writable string support")
76226586SdimLANGOPT(ConstStrings      , 1, 0, "const-qualified string support")
77226586SdimLANGOPT(LaxVectorConversions , 1, 1, "lax vector conversions")
78226586SdimLANGOPT(AltiVec           , 1, 0, "AltiVec-style vector initializers")
79226586SdimLANGOPT(Exceptions        , 1, 0, "exception handling")
80226586SdimLANGOPT(ObjCExceptions    , 1, 0, "Objective-C exceptions")
81226586SdimLANGOPT(CXXExceptions     , 1, 0, "C++ exceptions")
82226586SdimLANGOPT(SjLjExceptions    , 1, 0, "setjmp-longjump exception handling")
83226586SdimLANGOPT(TraditionalCPP    , 1, 0, "traditional CPP emulation")
84226586SdimLANGOPT(RTTI              , 1, 1, "run-time type information")
85226586SdimLANGOPT(MSBitfields       , 1, 0, "Microsoft-compatible structure layout")
86226586SdimLANGOPT(Freestanding, 1, 0, "freestanding implementation")
87226633SdimLANGOPT(FormatExtensions  , 1, 0, "FreeBSD format extensions")
88226586SdimLANGOPT(NoBuiltin         , 1, 0, "disable builtin functions")
89263508SdimLANGOPT(NoMathBuiltin     , 1, 0, "disable math builtin functions")
90226586Sdim
91226586SdimBENIGN_LANGOPT(ThreadsafeStatics , 1, 1, "thread-safe static initializers")
92226586SdimLANGOPT(POSIXThreads      , 1, 0, "POSIX thread support")
93226586SdimLANGOPT(Blocks            , 1, 0, "blocks extension to C")
94226586SdimBENIGN_LANGOPT(EmitAllDecls      , 1, 0, "support for emitting all declarations")
95226586SdimLANGOPT(MathErrno         , 1, 1, "errno support for math functions")
96226586SdimBENIGN_LANGOPT(HeinousExtensions , 1, 0, "Extensions that we really don't like and may be ripped out at any time")
97234353SdimLANGOPT(Modules           , 1, 0, "modules extension to C")
98263508SdimLANGOPT(ModulesDeclUse    , 1, 0, "require declaration of module uses")
99226586SdimLANGOPT(Optimize          , 1, 0, "__OPTIMIZE__ predefined macro")
100226586SdimLANGOPT(OptimizeSize      , 1, 0, "__OPTIMIZE_SIZE__ predefined macro")
101226586SdimLANGOPT(Static            , 1, 0, "__STATIC__ predefined macro (as opposed to __DYNAMIC__)")
102263508SdimVALUE_LANGOPT(PackStruct  , 32, 0,
103226586Sdim              "default struct packing maximum alignment")
104234353SdimVALUE_LANGOPT(PICLevel    , 2, 0, "__PIC__ level")
105234353SdimVALUE_LANGOPT(PIELevel    , 2, 0, "__PIE__ level")
106226586SdimLANGOPT(GNUInline         , 1, 0, "GNU inline semantics")
107234353SdimLANGOPT(NoInlineDefine    , 1, 0, "__NO_INLINE__ predefined macro")
108226586SdimLANGOPT(Deprecated        , 1, 0, "__DEPRECATED predefined macro")
109234353SdimLANGOPT(FastMath          , 1, 0, "__FAST_MATH__ predefined macro")
110239462SdimLANGOPT(FiniteMathOnly    , 1, 0, "__FINITE_MATH_ONLY__ predefined macro")
111226586Sdim
112226586SdimBENIGN_LANGOPT(ObjCGCBitmapPrint , 1, 0, "printing of GC's bitmap layout for __weak/__strong ivars")
113226586Sdim
114226586SdimBENIGN_LANGOPT(AccessControl     , 1, 1, "C++ access control")
115226586SdimLANGOPT(CharIsSigned      , 1, 1, "signed char")
116226586SdimLANGOPT(ShortWChar        , 1, 0, "unsigned short wchar_t")
117226586Sdim
118226586SdimLANGOPT(ShortEnums        , 1, 0, "short enum types")
119226586Sdim
120226586SdimLANGOPT(OpenCL            , 1, 0, "OpenCL")
121239462SdimLANGOPT(OpenCLVersion     , 32, 0, "OpenCL version")
122249423SdimLANGOPT(NativeHalfType    , 1, 0, "Native half type support")
123226586SdimLANGOPT(CUDA              , 1, 0, "CUDA")
124249423SdimLANGOPT(OpenMP            , 1, 0, "OpenMP support")
125226586Sdim
126226586SdimLANGOPT(AssumeSaneOperatorNew , 1, 1, "implicit __attribute__((malloc)) for C++'s new operators")
127263508SdimLANGOPT(SizedDeallocation , 1, 0, "enable sized deallocation functions")
128226586SdimBENIGN_LANGOPT(ElideConstructors , 1, 1, "C++ copy constructor elision")
129226586SdimBENIGN_LANGOPT(DumpRecordLayouts , 1, 0, "dumping the layout of IRgen'd records")
130234353SdimBENIGN_LANGOPT(DumpRecordLayoutsSimple , 1, 0, "dumping the layout of IRgen'd records in a simple form")
131226586SdimBENIGN_LANGOPT(DumpVTableLayouts , 1, 0, "dumping the layouts of emitted vtables")
132226586SdimLANGOPT(NoConstantCFStrings , 1, 0, "no constant CoreFoundation strings")
133226586SdimBENIGN_LANGOPT(InlineVisibilityHidden , 1, 0, "hidden default visibility for inline C++ methods")
134226586SdimBENIGN_LANGOPT(ParseUnknownAnytype, 1, 0, "__unknown_anytype")
135226586SdimBENIGN_LANGOPT(DebuggerSupport , 1, 0, "debugger support")
136234353SdimBENIGN_LANGOPT(DebuggerCastResultToId, 1, 0, "for 'po' in the debugger, cast the result to id if it is of unknown type")
137239462SdimBENIGN_LANGOPT(DebuggerObjCLiteral , 1, 0, "debugger Objective-C literals and subscripting support")
138226586Sdim
139226586SdimBENIGN_LANGOPT(SpellChecking , 1, 1, "spell-checking")
140226586SdimLANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants")
141226586SdimLANGOPT(FastRelaxedMath , 1, 0, "OpenCL fast relaxed math")
142226586SdimLANGOPT(DefaultFPContract , 1, 0, "FP_CONTRACT")
143226586SdimLANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment")
144234353SdimLANGOPT(HexagonQdsp6Compat , 1, 0, "hexagon-qdsp6 backward compatibility")
145226586SdimLANGOPT(ObjCAutoRefCount , 1, 0, "Objective-C automated reference counting")
146243830SdimLANGOPT(ObjCARCWeak         , 1, 0, "__weak support in the ARC runtime")
147263508SdimLANGOPT(ObjCSubscriptingLegacyRuntime         , 1, 0, "Subscripting support in legacy ObjectiveC runtime")
148226586SdimLANGOPT(FakeAddressSpaceMap , 1, 0, "OpenCL fake address space map")
149263508SdimENUM_LANGOPT(AddressSpaceMapMangling , AddrSpaceMapMangling, 2, ASMM_Target, "OpenCL address space map mangling mode")
150226586Sdim
151226586SdimLANGOPT(MRTD , 1, 0, "-mrtd calling convention")
152226586SdimBENIGN_LANGOPT(DelayedTemplateParsing , 1, 0, "delayed template parsing")
153226586SdimLANGOPT(BlocksRuntimeOptional , 1, 0, "optional blocks runtime")
154226586Sdim
155226586SdimENUM_LANGOPT(GC, GCMode, 2, NonGC, "Objective-C Garbage Collection mode")
156263508SdimENUM_LANGOPT(ValueVisibilityMode, Visibility, 3, DefaultVisibility,
157249423Sdim             "value symbol visibility")
158263508SdimENUM_LANGOPT(TypeVisibilityMode, Visibility, 3, DefaultVisibility,
159249423Sdim             "type symbol visibility")
160263508SdimENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff,
161226586Sdim             "stack protector mode")
162226586SdimENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined,
163226586Sdim             "signed integer overflow handling")
164226586Sdim
165263508SdimBENIGN_LANGOPT(ArrowDepth, 32, 256,
166263508Sdim               "maximum number of operator->s to follow")
167263508SdimBENIGN_LANGOPT(InstantiationDepth, 32, 256,
168226586Sdim               "maximum template instantiation depth")
169234353SdimBENIGN_LANGOPT(ConstexprCallDepth, 32, 512,
170234353Sdim               "maximum constexpr call depth")
171263508SdimBENIGN_LANGOPT(ConstexprStepLimit, 32, 1048576,
172263508Sdim               "maximum constexpr evaluation steps")
173249423SdimBENIGN_LANGOPT(BracketDepth, 32, 256,
174249423Sdim               "maximum bracket nesting depth")
175263508SdimBENIGN_LANGOPT(NumLargeByValueCopy, 32, 0,
176226586Sdim        "if non-zero, warn about parameter or return Warn if parameter/return value is larger in bytes than this setting. 0 is no check.")
177263508SdimVALUE_LANGOPT(MSCVersion, 32, 0,
178226586Sdim              "version of Microsoft Visual C/C++")
179226586Sdim
180234353SdimLANGOPT(ApplePragmaPack, 1, 0, "Apple gcc-compatible #pragma pack handling")
181234353Sdim
182243830SdimBENIGN_LANGOPT(RetainCommentsFromSystemHeaders, 1, 0, "retain documentation comments from system headers in the AST")
183243830Sdim
184226586Sdim#undef LANGOPT
185226586Sdim#undef VALUE_LANGOPT
186226586Sdim#undef BENIGN_LANGOPT
187226586Sdim#undef ENUM_LANGOPT
188226586Sdim#undef BENIGN_ENUM_LANGOPT
189226586Sdim
190