Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 1 | //===--- 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 Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 15 | // 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 Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 18 | // |
| 19 | //===----------------------------------------------------------------------===// |
| 20 | #ifndef LANGOPT |
| 21 | # error Define the LANGOPT macro to handle language options |
| 22 | #endif |
| 23 | |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 24 | #ifndef VALUE_LANGOPT |
| 25 | # define VALUE_LANGOPT(Name, Bits, Default, Description) \ |
| 26 | LANGOPT(Name, Bits, Default, Description) |
| 27 | #endif |
| 28 | |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 29 | #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 Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 44 | LANGOPT(C99 , 1, 0, "C99") |
Benjamin Kramer | ffbe9b9 | 2011-12-23 17:00:35 +0000 | [diff] [blame] | 45 | LANGOPT(C11 , 1, 0, "C11") |
Francois Pichet | 62ec1f2 | 2011-09-17 17:15:52 +0000 | [diff] [blame] | 46 | LANGOPT(MicrosoftExt , 1, 0, "Microsoft extensions") |
Francois Pichet | ae55608 | 2011-09-17 04:32:15 +0000 | [diff] [blame] | 47 | LANGOPT(MicrosoftMode , 1, 0, "Microsoft compatibility mode") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 48 | LANGOPT(Borland , 1, 0, "Borland extensions") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 49 | LANGOPT(CPlusPlus , 1, 0, "C++") |
| 50 | LANGOPT(CPlusPlus0x , 1, 0, "C++0x") |
| 51 | LANGOPT(ObjC1 , 1, 0, "Objective-C 1") |
| 52 | LANGOPT(ObjC2 , 1, 0, "Objective-C 2") |
| 53 | LANGOPT(ObjCNonFragileABI , 1, 0, "Objective-C modern abi") |
| 54 | LANGOPT(ObjCNonFragileABI2 , 1, 0, "Objective-C enhanced modern abi") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 55 | BENIGN_LANGOPT(ObjCDefaultSynthProperties , 1, 0, |
| 56 | "Objective-C auto-synthesized properties") |
| 57 | BENIGN_LANGOPT(ObjCInferRelatedResultType , 1, 1, |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 58 | "Objective-C related result type inference") |
| 59 | LANGOPT(Trigraphs , 1, 0,"trigraphs") |
| 60 | LANGOPT(BCPLComment , 1, 0, "BCPL-style '//' comments") |
| 61 | LANGOPT(Bool , 1, 0, "bool, true, and false keywords") |
Douglas Gregor | 1c7e047 | 2011-09-13 20:44:41 +0000 | [diff] [blame] | 62 | BENIGN_LANGOPT(DollarIdents , 1, 1, "'$' in identifiers") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 63 | BENIGN_LANGOPT(AsmPreprocessor, 1, 0, "preprocessor in asm mode") |
Douglas Gregor | 1c7e047 | 2011-09-13 20:44:41 +0000 | [diff] [blame] | 64 | BENIGN_LANGOPT(GNUMode , 1, 1, "GNU extensions") |
| 65 | LANGOPT(GNUKeywords , 1, 1, "GNU keywords") |
| 66 | BENIGN_LANGOPT(ImplicitInt, 1, !C99 && !CPlusPlus, "C89 implicit 'int'") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 67 | LANGOPT(Digraphs , 1, 0, "digraphs") |
Douglas Gregor | 1c7e047 | 2011-09-13 20:44:41 +0000 | [diff] [blame] | 68 | BENIGN_LANGOPT(HexFloats , 1, C99, "C99 hexadecimal float constants") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 69 | LANGOPT(CXXOperatorNames , 1, 0, "C++ operator name keywords") |
| 70 | LANGOPT(AppleKext , 1, 0, "Apple kext support") |
Douglas Gregor | 1c7e047 | 2011-09-13 20:44:41 +0000 | [diff] [blame] | 71 | BENIGN_LANGOPT(PascalStrings, 1, 0, "Pascal string support") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 72 | LANGOPT(WritableStrings , 1, 0, "writable string support") |
| 73 | LANGOPT(ConstStrings , 1, 0, "const-qualified string support") |
| 74 | LANGOPT(LaxVectorConversions , 1, 1, "lax vector conversions") |
| 75 | LANGOPT(AltiVec , 1, 0, "AltiVec-style vector initializers") |
| 76 | LANGOPT(Exceptions , 1, 0, "exception handling") |
| 77 | LANGOPT(ObjCExceptions , 1, 0, "Objective-C exceptions") |
| 78 | LANGOPT(CXXExceptions , 1, 0, "C++ exceptions") |
| 79 | LANGOPT(SjLjExceptions , 1, 0, "setjmp-longjump exception handling") |
| 80 | LANGOPT(TraditionalCPP , 1, 0, "traditional CPP emulation") |
| 81 | LANGOPT(RTTI , 1, 1, "run-time type information") |
| 82 | LANGOPT(MSBitfields , 1, 0, "Microsoft-compatible structure layout") |
| 83 | LANGOPT(NeXTRuntime , 1, 1, "NeXT Objective-C runtime") |
Douglas Gregor | 1c7e047 | 2011-09-13 20:44:41 +0000 | [diff] [blame] | 84 | LANGOPT(Freestanding, 1, 0, "freestanding implementation") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 85 | LANGOPT(NoBuiltin , 1, 0, "disable builtin functions") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 86 | |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 87 | BENIGN_LANGOPT(ThreadsafeStatics , 1, 1, "thread-safe static initializers") |
| 88 | LANGOPT(POSIXThreads , 1, 0, "POSIX thread support") |
Douglas Gregor | 1c7e047 | 2011-09-13 20:44:41 +0000 | [diff] [blame] | 89 | LANGOPT(Blocks , 1, 0, "blocks extension to C") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 90 | BENIGN_LANGOPT(EmitAllDecls , 1, 0, "support for emitting all declarations") |
| 91 | LANGOPT(MathErrno , 1, 1, "errno support for math functions") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 92 | BENIGN_LANGOPT(HeinousExtensions , 1, 0, "Extensions that we really don't like and may be ripped out at any time") |
Douglas Gregor | 752c74d | 2012-01-03 17:07:34 +0000 | [diff] [blame] | 93 | LANGOPT(Modules , 1, 0, "modules extension to C") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 94 | LANGOPT(Optimize , 1, 0, "__OPTIMIZE__ predefined macro") |
| 95 | LANGOPT(OptimizeSize , 1, 0, "__OPTIMIZE_SIZE__ predefined macro") |
| 96 | LANGOPT(Static , 1, 0, "__STATIC__ predefined macro (as opposed to __DYNAMIC__)") |
Daniel Dunbar | 88934e8 | 2011-10-05 21:04:55 +0000 | [diff] [blame] | 97 | VALUE_LANGOPT(PackStruct , 32, 0, |
| 98 | "default struct packing maximum alignment") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 99 | VALUE_LANGOPT(PICLevel , 2, 0, "__PIC__ level") |
| 100 | LANGOPT(GNUInline , 1, 0, "GNU inline semantics") |
| 101 | LANGOPT(NoInline , 1, 0, "__NO_INLINE__ predefined macro") |
| 102 | LANGOPT(Deprecated , 1, 0, "__DEPRECATED predefined macro") |
Chandler Carruth | abf07a7 | 2012-01-02 14:19:45 +0000 | [diff] [blame] | 103 | LANGOPT(FastMath , 1, 0, "__FAST_MATH__ predefined macro") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 104 | |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 105 | BENIGN_LANGOPT(ObjCGCBitmapPrint , 1, 0, "printing of GC's bitmap layout for __weak/__strong ivars") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 106 | |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 107 | BENIGN_LANGOPT(AccessControl , 1, 1, "C++ access control") |
| 108 | LANGOPT(CharIsSigned , 1, 1, "signed char") |
| 109 | LANGOPT(ShortWChar , 1, 0, "unsigned short wchar_t") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 110 | |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 111 | LANGOPT(ShortEnums , 1, 0, "short enum types") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 112 | |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 113 | LANGOPT(OpenCL , 1, 0, "OpenCL") |
| 114 | LANGOPT(CUDA , 1, 0, "CUDA") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 115 | |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 116 | LANGOPT(AssumeSaneOperatorNew , 1, 1, "implicit __attribute__((malloc)) for C++'s new operators") |
| 117 | BENIGN_LANGOPT(ElideConstructors , 1, 1, "C++ copy constructor elision") |
| 118 | BENIGN_LANGOPT(CatchUndefined , 1, 0, "catching undefined behavior at run time") |
| 119 | BENIGN_LANGOPT(DumpRecordLayouts , 1, 0, "dumping the layout of IRgen'd records") |
Douglas Gregor | 453dbcb | 2012-01-26 07:55:45 +0000 | [diff] [blame] | 120 | BENIGN_LANGOPT(DumpRecordLayoutsSimple , 1, 0, "dumping the layout of IRgen'd records in a simple form") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 121 | BENIGN_LANGOPT(DumpVTableLayouts , 1, 0, "dumping the layouts of emitted vtables") |
| 122 | LANGOPT(NoConstantCFStrings , 1, 0, "no constant CoreFoundation strings") |
| 123 | BENIGN_LANGOPT(InlineVisibilityHidden , 1, 0, "hidden default visibility for inline C++ methods") |
| 124 | BENIGN_LANGOPT(ParseUnknownAnytype, 1, 0, "__unknown_anytype") |
| 125 | BENIGN_LANGOPT(DebuggerSupport , 1, 0, "debugger support") |
Sean Callanan | 50a9a12 | 2012-02-04 01:29:37 +0000 | [diff] [blame] | 126 | BENIGN_LANGOPT(DebuggerCastResultToId, 1, 0, "for 'po' in the debugger, cast the result to id if it is of unknown type") |
Kostya Serebryany | b619688 | 2011-11-22 01:28:36 +0000 | [diff] [blame] | 127 | BENIGN_LANGOPT(AddressSanitizer , 1, 0, "AddressSanitizer enabled") |
Kostya Serebryany | 3c93122 | 2012-03-01 22:27:08 +0000 | [diff] [blame^] | 128 | BENIGN_LANGOPT(ThreadSanitizer , 1, 0, "ThreadSanitizer enabled") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 129 | |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 130 | BENIGN_LANGOPT(SpellChecking , 1, 1, "spell-checking") |
| 131 | LANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants") |
| 132 | LANGOPT(FastRelaxedMath , 1, 0, "OpenCL fast relaxed math") |
| 133 | LANGOPT(DefaultFPContract , 1, 0, "FP_CONTRACT") |
| 134 | LANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment") |
Tony Linthicum | 9631939 | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 135 | LANGOPT(HexagonQdsp6Compat , 1, 0, "hexagon-qdsp6 backward compatibility") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 136 | LANGOPT(ObjCAutoRefCount , 1, 0, "Objective-C automated reference counting") |
| 137 | LANGOPT(ObjCRuntimeHasWeak , 1, 0, "__weak support in the ARC runtime") |
| 138 | LANGOPT(FakeAddressSpaceMap , 1, 0, "OpenCL fake address space map") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 139 | |
| 140 | LANGOPT(MRTD , 1, 0, "-mrtd calling convention") |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 141 | BENIGN_LANGOPT(DelayedTemplateParsing , 1, 0, "delayed template parsing") |
| 142 | LANGOPT(BlocksRuntimeOptional , 1, 0, "optional blocks runtime") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 143 | |
| 144 | ENUM_LANGOPT(GC, GCMode, 2, NonGC, "Objective-C Garbage Collection mode") |
| 145 | ENUM_LANGOPT(VisibilityMode, Visibility, 3, DefaultVisibility, |
| 146 | "symbol visibility") |
| 147 | ENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff, |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 148 | "stack protector mode") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 149 | ENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined, |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 150 | "signed integer overflow handling") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 151 | |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 152 | BENIGN_LANGOPT(InstantiationDepth, 32, 1024, |
| 153 | "maximum template instantiation depth") |
Richard Smith | c18c423 | 2011-11-21 19:36:32 +0000 | [diff] [blame] | 154 | BENIGN_LANGOPT(ConstexprCallDepth, 32, 512, |
| 155 | "maximum constexpr call depth") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 156 | BENIGN_LANGOPT(NumLargeByValueCopy, 32, 0, |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 157 | "if non-zero, warn about parameter or return Warn if parameter/return value is larger in bytes than this setting. 0 is no check.") |
| 158 | VALUE_LANGOPT(MSCVersion, 32, 0, |
| 159 | "version of Microsoft Visual C/C++") |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 160 | |
Eli Friedman | 19bda3a | 2011-11-02 01:53:16 +0000 | [diff] [blame] | 161 | LANGOPT(ApplePragmaPack, 1, 0, "Apple gcc-compatible #pragma pack handling") |
| 162 | |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 163 | #undef LANGOPT |
Douglas Gregor | 7d5e81b | 2011-09-13 18:26:39 +0000 | [diff] [blame] | 164 | #undef VALUE_LANGOPT |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 165 | #undef BENIGN_LANGOPT |
| 166 | #undef ENUM_LANGOPT |
| 167 | #undef BENIGN_ENUM_LANGOPT |
| 168 | |