blob: d68afc737ddf7335cecf9b28aa412b60dfbf7780 [file] [log] [blame]
Douglas Gregore289d812011-09-13 17:21:33 +00001//===--- LangOptions.def - Language option database --------------- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the language options. Users of this file must
11// define the LANGOPT macro to make use of this information.
12// Optionally, the user may also define BENIGN_LANGOPT
13// (for options that don't affect the construction of the AST in an
14// incompatible way), ENUM_LANGOPT (for options that have enumeration,
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000015// rather than unsigned, type), BENIGN_ENUM_LANGOPT (for benign
16// options that have enumeration type), and VALUE_LANGOPT is a language option
17// that describes a value rather than a flag.
Douglas Gregore289d812011-09-13 17:21:33 +000018//
19//===----------------------------------------------------------------------===//
20#ifndef LANGOPT
21# error Define the LANGOPT macro to handle language options
22#endif
23
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000024#ifndef VALUE_LANGOPT
25# define VALUE_LANGOPT(Name, Bits, Default, Description) \
26 LANGOPT(Name, Bits, Default, Description)
27#endif
28
Douglas Gregore289d812011-09-13 17:21:33 +000029#ifndef BENIGN_LANGOPT
30# define BENIGN_LANGOPT(Name, Bits, Default, Description) \
31 LANGOPT(Name, Bits, Default, Description)
32#endif
33
34#ifndef ENUM_LANGOPT
35# define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
36 LANGOPT(Name, Bits, Default, Description)
37#endif
38
39#ifndef BENIGN_ENUM_LANGOPT
40# define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
41 ENUM_LANGOPT(Name, Type, Bits, Default, Description)
42#endif
43
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000044LANGOPT(C99 , 1, 0, "C99")
Benjamin Kramerffbe9b92011-12-23 17:00:35 +000045LANGOPT(C11 , 1, 0, "C11")
Francois Pichet62ec1f22011-09-17 17:15:52 +000046LANGOPT(MicrosoftExt , 1, 0, "Microsoft extensions")
Francois Pichetae556082011-09-17 04:32:15 +000047LANGOPT(MicrosoftMode , 1, 0, "Microsoft compatibility mode")
Douglas Gregore289d812011-09-13 17:21:33 +000048LANGOPT(Borland , 1, 0, "Borland extensions")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000049LANGOPT(CPlusPlus , 1, 0, "C++")
50LANGOPT(CPlusPlus0x , 1, 0, "C++0x")
51LANGOPT(ObjC1 , 1, 0, "Objective-C 1")
52LANGOPT(ObjC2 , 1, 0, "Objective-C 2")
53LANGOPT(ObjCNonFragileABI , 1, 0, "Objective-C modern abi")
54LANGOPT(ObjCNonFragileABI2 , 1, 0, "Objective-C enhanced modern abi")
Douglas Gregore289d812011-09-13 17:21:33 +000055BENIGN_LANGOPT(ObjCDefaultSynthProperties , 1, 0,
56 "Objective-C auto-synthesized properties")
57BENIGN_LANGOPT(ObjCInferRelatedResultType , 1, 1,
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000058 "Objective-C related result type inference")
59LANGOPT(Trigraphs , 1, 0,"trigraphs")
60LANGOPT(BCPLComment , 1, 0, "BCPL-style '//' comments")
61LANGOPT(Bool , 1, 0, "bool, true, and false keywords")
Douglas Gregor1c7e0472011-09-13 20:44:41 +000062BENIGN_LANGOPT(DollarIdents , 1, 1, "'$' in identifiers")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000063BENIGN_LANGOPT(AsmPreprocessor, 1, 0, "preprocessor in asm mode")
Douglas Gregor1c7e0472011-09-13 20:44:41 +000064BENIGN_LANGOPT(GNUMode , 1, 1, "GNU extensions")
65LANGOPT(GNUKeywords , 1, 1, "GNU keywords")
66BENIGN_LANGOPT(ImplicitInt, 1, !C99 && !CPlusPlus, "C89 implicit 'int'")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000067LANGOPT(Digraphs , 1, 0, "digraphs")
Douglas Gregor1c7e0472011-09-13 20:44:41 +000068BENIGN_LANGOPT(HexFloats , 1, C99, "C99 hexadecimal float constants")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000069LANGOPT(CXXOperatorNames , 1, 0, "C++ operator name keywords")
70LANGOPT(AppleKext , 1, 0, "Apple kext support")
Douglas Gregor1c7e0472011-09-13 20:44:41 +000071BENIGN_LANGOPT(PascalStrings, 1, 0, "Pascal string support")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000072LANGOPT(WritableStrings , 1, 0, "writable string support")
73LANGOPT(ConstStrings , 1, 0, "const-qualified string support")
74LANGOPT(LaxVectorConversions , 1, 1, "lax vector conversions")
75LANGOPT(AltiVec , 1, 0, "AltiVec-style vector initializers")
76LANGOPT(Exceptions , 1, 0, "exception handling")
77LANGOPT(ObjCExceptions , 1, 0, "Objective-C exceptions")
78LANGOPT(CXXExceptions , 1, 0, "C++ exceptions")
79LANGOPT(SjLjExceptions , 1, 0, "setjmp-longjump exception handling")
80LANGOPT(TraditionalCPP , 1, 0, "traditional CPP emulation")
81LANGOPT(RTTI , 1, 1, "run-time type information")
82LANGOPT(MSBitfields , 1, 0, "Microsoft-compatible structure layout")
83LANGOPT(NeXTRuntime , 1, 1, "NeXT Objective-C runtime")
Douglas Gregor1c7e0472011-09-13 20:44:41 +000084LANGOPT(Freestanding, 1, 0, "freestanding implementation")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000085LANGOPT(NoBuiltin , 1, 0, "disable builtin functions")
Douglas Gregore289d812011-09-13 17:21:33 +000086
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000087BENIGN_LANGOPT(ThreadsafeStatics , 1, 1, "thread-safe static initializers")
88LANGOPT(POSIXThreads , 1, 0, "POSIX thread support")
Douglas Gregor1c7e0472011-09-13 20:44:41 +000089LANGOPT(Blocks , 1, 0, "blocks extension to C")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000090BENIGN_LANGOPT(EmitAllDecls , 1, 0, "support for emitting all declarations")
91LANGOPT(MathErrno , 1, 1, "errno support for math functions")
Douglas Gregore289d812011-09-13 17:21:33 +000092BENIGN_LANGOPT(HeinousExtensions , 1, 0, "Extensions that we really don't like and may be ripped out at any time")
Douglas Gregor752c74d2012-01-03 17:07:34 +000093LANGOPT(Modules , 1, 0, "modules extension to C")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000094LANGOPT(Optimize , 1, 0, "__OPTIMIZE__ predefined macro")
95LANGOPT(OptimizeSize , 1, 0, "__OPTIMIZE_SIZE__ predefined macro")
96LANGOPT(Static , 1, 0, "__STATIC__ predefined macro (as opposed to __DYNAMIC__)")
Daniel Dunbar88934e82011-10-05 21:04:55 +000097VALUE_LANGOPT(PackStruct , 32, 0,
98 "default struct packing maximum alignment")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000099VALUE_LANGOPT(PICLevel , 2, 0, "__PIC__ level")
100LANGOPT(GNUInline , 1, 0, "GNU inline semantics")
101LANGOPT(NoInline , 1, 0, "__NO_INLINE__ predefined macro")
102LANGOPT(Deprecated , 1, 0, "__DEPRECATED predefined macro")
Chandler Carruthabf07a72012-01-02 14:19:45 +0000103LANGOPT(FastMath , 1, 0, "__FAST_MATH__ predefined macro")
Douglas Gregore289d812011-09-13 17:21:33 +0000104
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000105BENIGN_LANGOPT(ObjCGCBitmapPrint , 1, 0, "printing of GC's bitmap layout for __weak/__strong ivars")
Douglas Gregore289d812011-09-13 17:21:33 +0000106
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000107BENIGN_LANGOPT(AccessControl , 1, 1, "C++ access control")
108LANGOPT(CharIsSigned , 1, 1, "signed char")
109LANGOPT(ShortWChar , 1, 0, "unsigned short wchar_t")
Douglas Gregore289d812011-09-13 17:21:33 +0000110
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000111LANGOPT(ShortEnums , 1, 0, "short enum types")
Douglas Gregore289d812011-09-13 17:21:33 +0000112
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000113LANGOPT(OpenCL , 1, 0, "OpenCL")
114LANGOPT(CUDA , 1, 0, "CUDA")
Douglas Gregore289d812011-09-13 17:21:33 +0000115
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000116LANGOPT(AssumeSaneOperatorNew , 1, 1, "implicit __attribute__((malloc)) for C++'s new operators")
117BENIGN_LANGOPT(ElideConstructors , 1, 1, "C++ copy constructor elision")
118BENIGN_LANGOPT(CatchUndefined , 1, 0, "catching undefined behavior at run time")
119BENIGN_LANGOPT(DumpRecordLayouts , 1, 0, "dumping the layout of IRgen'd records")
Douglas Gregor453dbcb2012-01-26 07:55:45 +0000120BENIGN_LANGOPT(DumpRecordLayoutsSimple , 1, 0, "dumping the layout of IRgen'd records in a simple form")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000121BENIGN_LANGOPT(DumpVTableLayouts , 1, 0, "dumping the layouts of emitted vtables")
122LANGOPT(NoConstantCFStrings , 1, 0, "no constant CoreFoundation strings")
123BENIGN_LANGOPT(InlineVisibilityHidden , 1, 0, "hidden default visibility for inline C++ methods")
124BENIGN_LANGOPT(ParseUnknownAnytype, 1, 0, "__unknown_anytype")
125BENIGN_LANGOPT(DebuggerSupport , 1, 0, "debugger support")
Sean Callanan50a9a122012-02-04 01:29:37 +0000126BENIGN_LANGOPT(DebuggerCastResultToId, 1, 0, "for 'po' in the debugger, cast the result to id if it is of unknown type")
Kostya Serebryanyb6196882011-11-22 01:28:36 +0000127BENIGN_LANGOPT(AddressSanitizer , 1, 0, "AddressSanitizer enabled")
Kostya Serebryany3c931222012-03-01 22:27:08 +0000128BENIGN_LANGOPT(ThreadSanitizer , 1, 0, "ThreadSanitizer enabled")
Douglas Gregore289d812011-09-13 17:21:33 +0000129
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000130BENIGN_LANGOPT(SpellChecking , 1, 1, "spell-checking")
131LANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants")
132LANGOPT(FastRelaxedMath , 1, 0, "OpenCL fast relaxed math")
133LANGOPT(DefaultFPContract , 1, 0, "FP_CONTRACT")
134LANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment")
Tony Linthicum96319392011-12-12 21:14:55 +0000135LANGOPT(HexagonQdsp6Compat , 1, 0, "hexagon-qdsp6 backward compatibility")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000136LANGOPT(ObjCAutoRefCount , 1, 0, "Objective-C automated reference counting")
137LANGOPT(ObjCRuntimeHasWeak , 1, 0, "__weak support in the ARC runtime")
138LANGOPT(FakeAddressSpaceMap , 1, 0, "OpenCL fake address space map")
Douglas Gregore289d812011-09-13 17:21:33 +0000139
140LANGOPT(MRTD , 1, 0, "-mrtd calling convention")
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000141BENIGN_LANGOPT(DelayedTemplateParsing , 1, 0, "delayed template parsing")
142LANGOPT(BlocksRuntimeOptional , 1, 0, "optional blocks runtime")
Douglas Gregore289d812011-09-13 17:21:33 +0000143
144ENUM_LANGOPT(GC, GCMode, 2, NonGC, "Objective-C Garbage Collection mode")
145ENUM_LANGOPT(VisibilityMode, Visibility, 3, DefaultVisibility,
146 "symbol visibility")
147ENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff,
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000148 "stack protector mode")
Douglas Gregore289d812011-09-13 17:21:33 +0000149ENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined,
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000150 "signed integer overflow handling")
Douglas Gregore289d812011-09-13 17:21:33 +0000151
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000152BENIGN_LANGOPT(InstantiationDepth, 32, 1024,
153 "maximum template instantiation depth")
Richard Smithc18c4232011-11-21 19:36:32 +0000154BENIGN_LANGOPT(ConstexprCallDepth, 32, 512,
155 "maximum constexpr call depth")
Douglas Gregore289d812011-09-13 17:21:33 +0000156BENIGN_LANGOPT(NumLargeByValueCopy, 32, 0,
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000157 "if non-zero, warn about parameter or return Warn if parameter/return value is larger in bytes than this setting. 0 is no check.")
158VALUE_LANGOPT(MSCVersion, 32, 0,
159 "version of Microsoft Visual C/C++")
Douglas Gregore289d812011-09-13 17:21:33 +0000160
Eli Friedman19bda3a2011-11-02 01:53:16 +0000161LANGOPT(ApplePragmaPack, 1, 0, "Apple gcc-compatible #pragma pack handling")
162
Douglas Gregore289d812011-09-13 17:21:33 +0000163#undef LANGOPT
Douglas Gregor7d5e81b2011-09-13 18:26:39 +0000164#undef VALUE_LANGOPT
Douglas Gregore289d812011-09-13 17:21:33 +0000165#undef BENIGN_LANGOPT
166#undef ENUM_LANGOPT
167#undef BENIGN_ENUM_LANGOPT
168