summaryrefslogtreecommitdiff
path: root/include/clang/Basic/LangOptions.def
blob: 7e255c210283c6216024ba7a33917aff2e0b40b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
//===--- LangOptions.def - Language option database --------------- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the language options. Users of this file must
// define the LANGOPT macro to make use of this information. 
// Optionally, the user may also define BENIGN_LANGOPT
// (for options that don't affect the construction of the AST in an
// incompatible way), ENUM_LANGOPT (for options that have enumeration,
// rather than unsigned, type), BENIGN_ENUM_LANGOPT (for benign
// options that have enumeration type), and VALUE_LANGOPT is a language option
// that describes a value rather than a flag.
//
//===----------------------------------------------------------------------===//
#ifndef LANGOPT
#  error Define the LANGOPT macro to handle language options
#endif

#ifndef VALUE_LANGOPT
#  define VALUE_LANGOPT(Name, Bits, Default, Description) \
     LANGOPT(Name, Bits, Default, Description)
#endif

#ifndef BENIGN_LANGOPT
#  define BENIGN_LANGOPT(Name, Bits, Default, Description) \
     LANGOPT(Name, Bits, Default, Description)
#endif

#ifndef ENUM_LANGOPT
#  define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
     LANGOPT(Name, Bits, Default, Description)
#endif

#ifndef BENIGN_ENUM_LANGOPT
#  define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
     ENUM_LANGOPT(Name, Type, Bits, Default, Description)
#endif

LANGOPT(C99               , 1, 0, "C99")
LANGOPT(C11               , 1, 0, "C11")
LANGOPT(MicrosoftExt      , 1, 0, "Microsoft extensions")
LANGOPT(MicrosoftMode     , 1, 0, "Microsoft compatibility mode")
LANGOPT(Borland           , 1, 0, "Borland extensions")
LANGOPT(CPlusPlus         , 1, 0, "C++")
LANGOPT(CPlusPlus0x       , 1, 0, "C++0x")
LANGOPT(CPlusPlus1y       , 1, 0, "C++1y")
LANGOPT(ObjC1             , 1, 0, "Objective-C 1")
LANGOPT(ObjC2             , 1, 0, "Objective-C 2")
BENIGN_LANGOPT(ObjCDefaultSynthProperties , 1, 0, 
               "Objective-C auto-synthesized properties")
BENIGN_LANGOPT(ObjCInferRelatedResultType , 1, 1, 
               "Objective-C related result type inference")
LANGOPT(Trigraphs         , 1, 0,"trigraphs")
LANGOPT(LineComment       , 1, 0, "'//' comments")
LANGOPT(Bool              , 1, 0, "bool, true, and false keywords")
LANGOPT(WChar             , 1, CPlusPlus, "wchar_t keyword")
BENIGN_LANGOPT(DollarIdents   , 1, 1, "'$' in identifiers")
BENIGN_LANGOPT(AsmPreprocessor, 1, 0, "preprocessor in asm mode")
BENIGN_LANGOPT(GNUMode        , 1, 1, "GNU extensions")
LANGOPT(GNUKeywords       , 1, 1, "GNU keywords")
BENIGN_LANGOPT(ImplicitInt, 1, !C99 && !CPlusPlus, "C89 implicit 'int'")
LANGOPT(Digraphs          , 1, 0, "digraphs")
BENIGN_LANGOPT(HexFloats  , 1, C99, "C99 hexadecimal float constants")
LANGOPT(CXXOperatorNames  , 1, 0, "C++ operator name keywords")
LANGOPT(AppleKext         , 1, 0, "Apple kext support")
BENIGN_LANGOPT(PascalStrings, 1, 0, "Pascal string support")
LANGOPT(WritableStrings   , 1, 0, "writable string support")
LANGOPT(ConstStrings      , 1, 0, "const-qualified string support")
LANGOPT(LaxVectorConversions , 1, 1, "lax vector conversions")
LANGOPT(AltiVec           , 1, 0, "AltiVec-style vector initializers")
LANGOPT(Exceptions        , 1, 0, "exception handling")
LANGOPT(ObjCExceptions    , 1, 0, "Objective-C exceptions")
LANGOPT(CXXExceptions     , 1, 0, "C++ exceptions")
LANGOPT(SjLjExceptions    , 1, 0, "setjmp-longjump exception handling")
LANGOPT(TraditionalCPP    , 1, 0, "traditional CPP emulation")
LANGOPT(RTTI              , 1, 1, "run-time type information")
LANGOPT(MSBitfields       , 1, 0, "Microsoft-compatible structure layout")
LANGOPT(Freestanding, 1, 0, "freestanding implementation")
LANGOPT(NoBuiltin         , 1, 0, "disable builtin functions")

BENIGN_LANGOPT(ThreadsafeStatics , 1, 1, "thread-safe static initializers")
LANGOPT(POSIXThreads      , 1, 0, "POSIX thread support")
LANGOPT(Blocks            , 1, 0, "blocks extension to C")
BENIGN_LANGOPT(EmitAllDecls      , 1, 0, "support for emitting all declarations")
LANGOPT(MathErrno         , 1, 1, "errno support for math functions")
BENIGN_LANGOPT(HeinousExtensions , 1, 0, "Extensions that we really don't like and may be ripped out at any time")
LANGOPT(Modules           , 1, 0, "modules extension to C")
LANGOPT(Optimize          , 1, 0, "__OPTIMIZE__ predefined macro")
LANGOPT(OptimizeSize      , 1, 0, "__OPTIMIZE_SIZE__ predefined macro")
LANGOPT(Static            , 1, 0, "__STATIC__ predefined macro (as opposed to __DYNAMIC__)")
VALUE_LANGOPT(PackStruct  , 32, 0, 
              "default struct packing maximum alignment")
VALUE_LANGOPT(PICLevel    , 2, 0, "__PIC__ level")
VALUE_LANGOPT(PIELevel    , 2, 0, "__PIE__ level")
LANGOPT(GNUInline         , 1, 0, "GNU inline semantics")
LANGOPT(NoInlineDefine    , 1, 0, "__NO_INLINE__ predefined macro")
LANGOPT(Deprecated        , 1, 0, "__DEPRECATED predefined macro")
LANGOPT(FastMath          , 1, 0, "__FAST_MATH__ predefined macro")
LANGOPT(FiniteMathOnly    , 1, 0, "__FINITE_MATH_ONLY__ predefined macro")

BENIGN_LANGOPT(ObjCGCBitmapPrint , 1, 0, "printing of GC's bitmap layout for __weak/__strong ivars")

BENIGN_LANGOPT(AccessControl     , 1, 1, "C++ access control")
LANGOPT(CharIsSigned      , 1, 1, "signed char")
LANGOPT(ShortWChar        , 1, 0, "unsigned short wchar_t")

LANGOPT(ShortEnums        , 1, 0, "short enum types")

LANGOPT(OpenCL            , 1, 0, "OpenCL")
LANGOPT(OpenCLVersion     , 32, 0, "OpenCL version")
LANGOPT(CUDA              , 1, 0, "CUDA")

LANGOPT(AssumeSaneOperatorNew , 1, 1, "implicit __attribute__((malloc)) for C++'s new operators")
BENIGN_LANGOPT(ElideConstructors , 1, 1, "C++ copy constructor elision")
BENIGN_LANGOPT(DumpRecordLayouts , 1, 0, "dumping the layout of IRgen'd records")
BENIGN_LANGOPT(DumpRecordLayoutsSimple , 1, 0, "dumping the layout of IRgen'd records in a simple form")
BENIGN_LANGOPT(DumpVTableLayouts , 1, 0, "dumping the layouts of emitted vtables")
LANGOPT(NoConstantCFStrings , 1, 0, "no constant CoreFoundation strings")
BENIGN_LANGOPT(InlineVisibilityHidden , 1, 0, "hidden default visibility for inline C++ methods")
BENIGN_LANGOPT(ParseUnknownAnytype, 1, 0, "__unknown_anytype")
BENIGN_LANGOPT(DebuggerSupport , 1, 0, "debugger support")
BENIGN_LANGOPT(DebuggerCastResultToId, 1, 0, "for 'po' in the debugger, cast the result to id if it is of unknown type")
BENIGN_LANGOPT(DebuggerObjCLiteral , 1, 0, "debugger Objective-C literals and subscripting support")

BENIGN_LANGOPT(SpellChecking , 1, 1, "spell-checking")
LANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants")
LANGOPT(FastRelaxedMath , 1, 0, "OpenCL fast relaxed math")
LANGOPT(DefaultFPContract , 1, 0, "FP_CONTRACT")
LANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment")
LANGOPT(HexagonQdsp6Compat , 1, 0, "hexagon-qdsp6 backward compatibility")
LANGOPT(ObjCAutoRefCount , 1, 0, "Objective-C automated reference counting")
LANGOPT(ObjCARCWeak         , 1, 0, "__weak support in the ARC runtime")
LANGOPT(FakeAddressSpaceMap , 1, 0, "OpenCL fake address space map")

LANGOPT(MRTD , 1, 0, "-mrtd calling convention")
BENIGN_LANGOPT(DelayedTemplateParsing , 1, 0, "delayed template parsing")
LANGOPT(BlocksRuntimeOptional , 1, 0, "optional blocks runtime")

ENUM_LANGOPT(GC, GCMode, 2, NonGC, "Objective-C Garbage Collection mode")
ENUM_LANGOPT(VisibilityMode, Visibility, 3, DefaultVisibility, 
             "symbol visibility")
ENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff, 
             "stack protector mode")
ENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined,
             "signed integer overflow handling")
ENUM_LANGOPT(FPContractMode, FPContractModeKind, 2, FPC_On, "FP_CONTRACT mode")

BENIGN_LANGOPT(InstantiationDepth, 32, 512, 
               "maximum template instantiation depth")
BENIGN_LANGOPT(ConstexprCallDepth, 32, 512,
               "maximum constexpr call depth")
BENIGN_LANGOPT(NumLargeByValueCopy, 32, 0, 
        "if non-zero, warn about parameter or return Warn if parameter/return value is larger in bytes than this setting. 0 is no check.")
VALUE_LANGOPT(MSCVersion, 32, 0, 
              "version of Microsoft Visual C/C++")

LANGOPT(ApplePragmaPack, 1, 0, "Apple gcc-compatible #pragma pack handling")

BENIGN_LANGOPT(EmitMicrosoftInlineAsm , 1, 0, 
               "Enable emission of MS-style inline assembly.")


BENIGN_LANGOPT(RetainCommentsFromSystemHeaders, 1, 0, "retain documentation comments from system headers in the AST")

/// Runtime sanitizers.
#define SANITIZER(NAME, ID) \
BENIGN_LANGOPT(Sanitize##ID, 1, 0, NAME " sanitizer")
#include "clang/Basic/Sanitizers.def"

#undef LANGOPT
#undef VALUE_LANGOPT
#undef BENIGN_LANGOPT
#undef ENUM_LANGOPT
#undef BENIGN_ENUM_LANGOPT