clang: include/clang/Basic/LangOptions.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_CLANG_BASIC_LANGOPTIONS_H
15#define LLVM_CLANG_BASIC_LANGOPTIONS_H
16
25#include "llvm/ADT/FloatingPointMode.h"
26#include "llvm/ADT/StringRef.h"
27#include "llvm/BinaryFormat/DXContainer.h"
28#include "llvm/Support/AllocToken.h"
29#include "llvm/TargetParser/Triple.h"
30#include
31#include
32#include
33
35
36
37
39
40
41
42
43
62
69
70
71
75
76public:
80
81
82
84
85
87
88
89
91
92
93
95 };
96
99
100
101
102
104
106
108
109
111
112
114 };
115
116
118
120
121
123
124
126
127
129 };
130
137
139
149
151
152
167
176
187
188
190#define ABI_VER_MAJOR_MINOR(Major, Minor) Ver##Major##_##Minor,
191#define ABI_VER_MAJOR(Major) Ver##Major,
192#define ABI_VER_LATEST(Latest) Latest
193#include "clang/Basic/ABIVersions.def"
194 };
195
197
199
201
203
205
207
209
211 };
212
214
216
217
219
220
222
223
225 };
226
227
238
239
241
243
245
247
248
249
250
252 };
253
260
262
264
266
267
269
270
272 };
273
275
276
278
280
282
284 };
285
294
301
308
315
322
323
324
326
328
330
332
334
336
338 };
339
347
358
369
380
381
382
384
385
386
387
388
390
391
392
393
395
396
397
398
399
400
401
402
404
405
406
407
409
410
412 };
413
414
423
433
434
435#define LANGOPT(Name, Bits, Default, Compatibility, Description) \
436 unsigned Name : Bits;
437#define ENUM_LANGOPT(Name, Type, Bits, Default, Compatibility, Description)
438#include "clang/Basic/LangOptions.def"
439
440protected:
441
442
443#define LANGOPT(Name, Bits, Default, Compatibility, Description)
444#define ENUM_LANGOPT(Name, Type, Bits, Default, Compatibility, Description) \
445 LLVM_PREFERRED_TYPE(Type) \
446 unsigned Name : Bits;
447#include "clang/Basic/LangOptions.def"
448};
449
450
451
453public:
454
456
457
459
461
462
463
465
466
467
468
469
471
472
473
474
475
477
478
479
480
482
483
484
486
488
490
492
493
494
495
496
498
499
501
502
503
504
505
506
508
509
510
511
512
514
515
517
518
520
521
522 std::map<std::string, std::string, std::greaterstd::string> MacroPrefixMap;
523
524
525
527
528
529
531
532
533
534
535
537
538
539
540 std::optionalTargetCXXABI::Kind CXXABI;
541
542
543
545
546
548
549
551
553
554
556
557
558
559
560
561
562
564
565
566
568
569
571
572
573
575
576
577
579
580
581
585
586
587
589
590
592
594
595
596
597
598
599
600
601
602
603
604 static void
606 std::vectorstd::string &Includes,
608
609
610#define LANGOPT(Name, Bits, Default, Compatibility, Description)
611#define ENUM_LANGOPT(Name, Type, Bits, Default, Compatibility, Description) \
612 Type get##Name() const { return static_cast(Name); } \
613 void set##Name(Type Value) { \
614 assert(static_cast(Value) < (1u << Bits)); \
615 Name = static_cast(Value); \
616 }
617#include "clang/Basic/LangOptions.def"
618
619
621 return getCompilingModule() != CMK_None;
622 }
623
624
628
629
633
635 return getSignedOverflowBehavior() == SOB_Defined;
636 }
637
639 return ObjCRuntime.isSubscriptPointerArithmetic() &&
640 !ObjCSubscriptingLegacyRuntime;
641 }
642
644
646 return MSCompatibilityVersion >= MajorVersion * 100000U;
647 }
648
651 return false;
653 return true;
655 }
656
657
658
660
661
662
664
665
667 return ObjCAutoRefCount || ObjCWeak;
668 }
669
671 return ConvergentFunctions;
672 }
673
674
675
681
682
684
685
687
688
689
691
692
693
697
698
699
703
704
705 bool hasAtExit() const { return !(OpenMP && OpenMPIsTargetDevice); }
706
707
709
710
712
713
717
718
722
723
727
728 bool isSYCL() const { return SYCLIsDevice || SYCLIsHost; }
729
731 return getDefaultVisibilityExportMapping() !=
733 }
734
736 return getDefaultVisibilityExportMapping() ==
738 }
739
741 return getDefaultVisibilityExportMapping() ==
743 }
744
746 return getGlobalAllocationFunctionVisibility() !=
748 }
749
751 return getGlobalAllocationFunctionVisibility() ==
753 }
754
756 return getGlobalAllocationFunctionVisibility() ==
758 }
759
761 return getGlobalAllocationFunctionVisibility() ==
763 }
764
766
767
769
771 return RoundingMath ? RoundingMode::Dynamic
772 : RoundingMode::NearestTiesToEven;
773 }
774
781
782
784 return OpenMPIsTargetDevice || CUDAIsDevice || SYCLIsDevice;
785 }
786
787
788
789 std::optional<uint32_t> getCLangStd() const;
790
791
792
793
795};
796
797
798class FPOptionsOverride;
800public:
801
803
805
807
808
809
811#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
812 static constexpr storage_type NAME##Shift = \
813 PREVIOUS##Shift + PREVIOUS##Width; \
814 static constexpr storage_type NAME##Width = WIDTH; \
815 static constexpr storage_type NAME##Mask = ((1 << NAME##Width) - 1) \
816 << NAME##Shift;
817#include "clang/Basic/FPOptions.def"
818
820#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) +WIDTH
821#include "clang/Basic/FPOptions.def"
822 ;
824
825private:
827
829
830public:
833 setConstRoundingMode(RoundingMode::Dynamic);
835 }
837 Value = 0;
838
839
840
841 auto LangOptContractMode = LO.getDefaultFPContractMode();
844 setFPContractMode(LangOptContractMode);
845 setRoundingMath(LO.RoundingMath);
846 setConstRoundingMode(LangOptions::RoundingMode::Dynamic);
847 setSpecifiedExceptionMode(LO.getFPExceptionMode());
848 setAllowFPReassociate(LO.AllowFPReassoc);
849 setNoHonorNaNs(LO.NoHonorNaNs);
850 setNoHonorInfs(LO.NoHonorInfs);
851 setNoSignedZero(LO.NoSignedZero);
852 setAllowReciprocal(LO.AllowRecip);
853 setAllowApproxFunc(LO.ApproxFunc);
857
858
859 setAllowFEnvAccess(true);
860 else
862 setComplexRange(LO.getComplexRange());
863 }
864
871
878
880 return getRoundingMode() != llvm::RoundingMode::NearestTiesToEven ||
882 getAllowFEnvAccess();
883 }
884
887 if (RM == RoundingMode::Dynamic) {
888
889
890
891 if (!getAllowFEnvAccess() && !getRoundingMath())
892 RM = RoundingMode::NearestTiesToEven;
893 }
894 return RM;
895 }
896
900 if (getAllowFEnvAccess())
902 else
904 }
905 return EM;
906 }
907
909
910
911
913
917 Opts.Value = Value;
918 return Opts;
919 }
920
921
923
925
926
927
928
929#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
930 TYPE get##NAME() const { \
931 return static_cast((Value & NAME##Mask) >> NAME##Shift); \
932 } \
933 void set##NAME(TYPE value) { \
934 assert(storage_type(value) < (1u << WIDTH)); \
935 Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift); \
936 }
937#include "clang/Basic/FPOptions.def"
938 LLVM_DUMP_METHOD void dump();
939};
940
941
942
943
944
945
946
947
948
949
950
951
952
953
957
958public:
960
961
962
965 "Too short type for FPOptionsOverride");
966
967
968
971
978 : Options(FPO), OverrideMask(Mask) {}
979
981
985
989
993
995 setAllowFPReassociateOverride();
996 setNoHonorNaNsOverride();
997 setNoHonorInfsOverride();
998 setNoSignedZeroOverride();
999 setAllowReciprocalOverride();
1000 setAllowApproxFuncOverride();
1001 setMathErrnoOverride(Value);
1003
1005 else
1006
1008 }
1009
1011
1013 return (static_cast<storage_type>(Options.getAsOpaqueInt())
1015 OverrideMask;
1016 }
1023
1027 (Options.getAsOpaqueInt() & OverrideMask));
1029 }
1030
1034
1036 return Options == other.Options && OverrideMask == other.OverrideMask;
1037 }
1039
1040#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1041 bool has##NAME##Override() const { \
1042 return OverrideMask & FPOptions::NAME##Mask; \
1043 } \
1044 TYPE get##NAME##Override() const { \
1045 assert(has##NAME##Override()); \
1046 return Options.get##NAME(); \
1047 } \
1048 void clear##NAME##Override() { \
1049
1050 \
1051 Options.set##NAME(TYPE(0)); \
1052 OverrideMask &= ~FPOptions::NAME##Mask; \
1053 } \
1054 void set##NAME##Override(TYPE value) { \
1055 Options.set##NAME(value); \
1056 OverrideMask |= FPOptions::NAME##Mask; \
1057 }
1058#include "clang/Basic/FPOptions.def"
1059 LLVM_DUMP_METHOD void dump();
1060};
1063 if (Value == Base.Value)
1065 return getChangesSlow(Base);
1066}
1070}
1071
1072
1073
1074
1075
1082};
1099 switch (Kind) {
1106 }
1107 llvm_unreachable("Invalid AtomicOptionKind");
1108 }
1111 switch (Kind) {
1114 return;
1117 return;
1120 return;
1121 }
1122 llvm_unreachable("Invalid AtomicOptionKind");
1123 }
1125 LLVM_DUMP_METHOD void dump() const {
1126 llvm::errs() << "\n remote_memory: " << remote_memory
1129 }
1130};
1131
1147};
1148
1149}
1150
1151#endif
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines types useful for describing an Objective-C runtime.
Defines the clang::SanitizerKind enum.
Defines the TargetCXXABI class, which abstracts details of the C++ ABI that we're targeting.
Defines the clang::Visibility enumeration and various utility functions.
Represents difference between two FPOptions values.
Definition LangOptions.h:954
void setAllowFPContractAcrossStatement()
Definition LangOptions.h:986
static FPOptionsOverride getFromOpaqueInt(storage_type I)
Definition LangOptions.h:1017
bool operator!=(FPOptionsOverride other) const
Definition LangOptions.h:1038
FPOptionsOverride(FPOptions FPO)
Definition LangOptions.h:975
FPOptionsOverride()
Definition LangOptions.h:972
LLVM_DUMP_METHOD void dump()
void setFPPreciseEnabled(bool Value)
Definition LangOptions.h:994
void setAllowFPContractWithinStatement()
Definition LangOptions.h:982
FPOptionsOverride(FPOptions FPO, FPOptions::storage_type Mask)
Definition LangOptions.h:977
FPOptions applyOverrides(FPOptions Base)
Definition LangOptions.h:1024
bool operator==(FPOptionsOverride other) const
Definition LangOptions.h:1035
void setDisallowFPContract()
Definition LangOptions.h:990
llvm::RoundingMode RoundingMode
Definition LangOptions.h:959
static constexpr storage_type OverrideMaskBits
Bit mask selecting bits of OverrideMask in serialized representation of FPOptionsOverride.
Definition LangOptions.h:969
storage_type getAsOpaqueInt() const
Definition LangOptions.h:1012
void setDisallowOptimizations()
Definition LangOptions.h:1010
FPOptions applyOverrides(const LangOptions &LO)
Definition LangOptions.h:1031
uint64_t storage_type
The type suitable for storing values of FPOptionsOverride.
Definition LangOptions.h:963
FPOptionsOverride(const LangOptions &LO)
Definition LangOptions.h:973
bool requiresTrailingStorage() const
Definition LangOptions.h:980
Definition LangOptions.h:799
void applyChanges(FPOptionsOverride FPO)
Definition LangOptions.h:1067
bool isFPConstrained() const
Definition LangOptions.h:879
static constexpr storage_type FirstShift
Definition LangOptions.h:810
FPOptionsOverride getChangesFrom(const FPOptions &Base) const
Return difference with the given option set.
Definition LangOptions.h:1061
storage_type getAsOpaqueInt() const
Definition LangOptions.h:914
static constexpr storage_type TotalWidth
Definition LangOptions.h:819
LangOptions::FPExceptionModeKind getExceptionMode() const
Definition LangOptions.h:897
FPOptions()
Definition LangOptions.h:831
FPOptions(const LangOptions &LO)
Definition LangOptions.h:836
static constexpr storage_type FirstWidth
Definition LangOptions.h:810
void setAllowFPContractWithinStatement()
Definition LangOptions.h:868
static FPOptions defaultWithoutTrailingStorage(const LangOptions &LO)
Return the default value of FPOptions that's used when trailing storage isn't required.
static FPOptions getFromOpaqueInt(storage_type Value)
Definition LangOptions.h:915
bool allowFPContractAcrossStatement() const
Definition LangOptions.h:872
uint32_t storage_type
Definition LangOptions.h:802
bool operator==(FPOptions other) const
Definition LangOptions.h:908
bool allowFPContractWithinStatement() const
Definition LangOptions.h:865
LLVM_DUMP_METHOD void dump()
void setAllowFPContractAcrossStatement()
Definition LangOptions.h:875
static constexpr unsigned StorageBitSize
Definition LangOptions.h:806
llvm::RoundingMode RoundingMode
Definition LangOptions.h:804
RoundingMode getRoundingMode() const
Definition LangOptions.h:885
Bitfields of LangOptions, split out from LangOptions in order to ensure that this large collection of...
Definition LangOptions.h:72
DefaultCallingConvention
Definition LangOptions.h:140
@ DCC_VectorCall
Definition LangOptions.h:145
@ DCC_FastCall
Definition LangOptions.h:143
@ DCC_RtdCall
Definition LangOptions.h:147
@ DCC_None
Definition LangOptions.h:141
@ DCC_RegCall
Definition LangOptions.h:146
@ DCC_StdCall
Definition LangOptions.h:144
@ DCC_CDecl
Definition LangOptions.h:142
FPEvalMethodKind
Possible float expression evaluation method choices.
Definition LangOptions.h:240
@ FEM_Extended
Use extended type for fp arithmetic.
Definition LangOptions.h:246
@ FEM_Double
Use the type double for fp arithmetic.
Definition LangOptions.h:244
@ FEM_UnsetOnCommandLine
Used only for FE option processing; this is only used to indicate that the user did not specify an ex...
Definition LangOptions.h:251
@ FEM_Source
Use the declared type for fp arithmetic.
Definition LangOptions.h:242
SignReturnAddressScopeKind
Definition LangOptions.h:286
@ None
No signing for any function.
Definition LangOptions.h:288
@ NonLeaf
Sign the return address of functions that spill LR.
Definition LangOptions.h:290
@ All
Sign the return address of all functions,.
Definition LangOptions.h:292
CompilingModuleKind
Definition LangOptions.h:117
@ CMK_None
Not compiling a module interface at all.
Definition LangOptions.h:119
@ CMK_HeaderUnit
Compiling a module header unit.
Definition LangOptions.h:125
@ CMK_ModuleMap
Compiling a module from a module map.
Definition LangOptions.h:122
@ CMK_ModuleInterface
Compiling a C++ modules interface unit.
Definition LangOptions.h:128
ComplexRangeKind
Controls the various implementations for complex multiplication and.
Definition LangOptions.h:383
@ CX_Full
Implementation of complex division and multiplication using a call to runtime library functions(gener...
Definition LangOptions.h:389
@ CX_Basic
Implementation of complex division and multiplication using algebraic formulas at source precision.
Definition LangOptions.h:408
@ CX_Promoted
Implementation of complex division using algebraic formulas at higher precision.
Definition LangOptions.h:403
@ CX_None
No range rule is enabled.
Definition LangOptions.h:411
@ CX_Improved
Implementation of complex division offering an improved handling for overflow in intermediate calcula...
Definition LangOptions.h:394
SignedOverflowBehaviorTy
Definition LangOptions.h:105
@ SOB_Trapping
Definition LangOptions.h:113
@ SOB_Undefined
Definition LangOptions.h:107
@ SOB_Defined
Definition LangOptions.h:110
TrivialAutoVarInitKind
Definition LangOptions.h:103
@ Pattern
Definition LangOptions.h:103
@ Zero
Definition LangOptions.h:103
@ Uninitialized
Definition LangOptions.h:103
MatrixMemoryLayout
Definition LangOptions.h:254
@ MatrixColMajor
Definition LangOptions.h:256
@ MatrixRowMajor
Definition LangOptions.h:258
CoreFoundationABI
Definition LangOptions.h:196
@ Swift5_0
Interoperability with the Swift 5.0 runtime.
Definition LangOptions.h:206
@ ObjectiveC
Interoperability with the ObjectiveC runtime.
Definition LangOptions.h:202
@ Standalone
CoreFoundation does not have any language interoperability.
Definition LangOptions.h:200
@ Unspecified
No interoperability ABI has been specified.
Definition LangOptions.h:198
@ Swift
Interoperability with the latest known version of the Swift runtime.
Definition LangOptions.h:204
@ Swift4_2
Interoperability with the Swift 4.2 runtime.
Definition LangOptions.h:208
@ Swift4_1
Interoperability with the Swift 4.1 runtime.
Definition LangOptions.h:210
MSVCMajorVersion
Definition LangOptions.h:153
@ MSVC2019_5
Definition LangOptions.h:162
@ MSVC2015
Definition LangOptions.h:157
@ MSVC2022_3
Definition LangOptions.h:164
@ MSVC2010
Definition LangOptions.h:154
@ MSVC2017_7
Definition LangOptions.h:160
@ MSVC2017
Definition LangOptions.h:158
@ MSVC2022_9
Definition LangOptions.h:165
@ MSVC2019
Definition LangOptions.h:161
@ MSVC2017_5
Definition LangOptions.h:159
@ MSVC2019_8
Definition LangOptions.h:163
@ MSVC2012
Definition LangOptions.h:155
@ MSVC2013
Definition LangOptions.h:156
llvm::RoundingMode RoundingMode
Definition LangOptions.h:78
AltivecSrcCompatKind
Definition LangOptions.h:274
@ GCC
Definition LangOptions.h:279
@ Mixed
Definition LangOptions.h:277
@ Default
Definition LangOptions.h:283
@ XL
Definition LangOptions.h:281
clang::MSVtorDispMode MSVtorDispMode
Definition LangOptions.h:138
GPUDefaultStreamKind
Definition LangOptions.h:316
@ Legacy
Legacy default stream.
Definition LangOptions.h:318
@ PerThread
Per-thread default stream.
Definition LangOptions.h:320
VisibilityForcedKinds
Definition LangOptions.h:348
@ ForceProtected
Force protected visibility.
Definition LangOptions.h:352
@ ForceDefault
Force default visibility.
Definition LangOptions.h:354
@ ForceHidden
Force hidden visibility.
Definition LangOptions.h:350
@ Source
Don't alter the visibility.
Definition LangOptions.h:356
SignReturnAddressKeyKind
Definition LangOptions.h:295
@ BKey
Return address signing uses APIB key.
Definition LangOptions.h:299
@ AKey
Return address signing uses APIA key.
Definition LangOptions.h:297
ExtendArgsKind
Definition LangOptions.h:309
@ ExtendTo32
Integer arguments are sign or zero extended to 32/64 bits during default argument promotions.
Definition LangOptions.h:312
@ ExtendTo64
Definition LangOptions.h:313
ThreadModelKind
Definition LangOptions.h:302
@ POSIX
POSIX Threads.
Definition LangOptions.h:304
@ Single
Single Threaded Environment.
Definition LangOptions.h:306
StackProtectorMode
Definition LangOptions.h:98
@ SSPReq
Definition LangOptions.h:98
@ SSPOn
Definition LangOptions.h:98
@ SSPOff
Definition LangOptions.h:98
@ SSPStrong
Definition LangOptions.h:98
GCMode
Definition LangOptions.h:97
@ HybridGC
Definition LangOptions.h:97
@ NonGC
Definition LangOptions.h:97
@ GCOnly
Definition LangOptions.h:97
LaxVectorConversionKind
Definition LangOptions.h:263
@ Integer
Permit vector bitcasts between integer vectors with different numbers of elements but the same total ...
Definition LangOptions.h:268
StrictFlexArraysLevelKind
Definition LangOptions.h:370
@ ZeroOrIncomplete
Any trailing array member of undefined or 0 size is a FAM.
Definition LangOptions.h:376
@ OneZeroOrIncomplete
Any trailing array member of undefined, 0, or 1 size is a FAM.
Definition LangOptions.h:374
@ IncompleteOnly
Any trailing array member of undefined size is a FAM.
Definition LangOptions.h:378
LayoutCompatibilityKind
Definition LangOptions.h:424
@ Microsoft
Use Microsoft C++ ABI rules for bit-field layout and fundamental types alignment.
Definition LangOptions.h:431
@ Itanium
Use Itanium rules for bit-field layout and fundamental types alignment.
Definition LangOptions.h:428
FPModeKind
Definition LangOptions.h:213
@ FPM_Fast
Definition LangOptions.h:221
@ FPM_Off
Definition LangOptions.h:215
@ FPM_FastHonorPragmas
Definition LangOptions.h:224
@ FPM_On
Definition LangOptions.h:218
friend class CompilerInvocationBase
Definition LangOptions.h:74
PragmaMSPointersToMembersKind
Definition LangOptions.h:131
@ PPTMK_FullGeneralityMultipleInheritance
Definition LangOptions.h:134
@ PPTMK_BestCase
Definition LangOptions.h:132
@ PPTMK_FullGeneralityVirtualInheritance
Definition LangOptions.h:135
@ PPTMK_FullGeneralitySingleInheritance
Definition LangOptions.h:133
OverflowPatternExclusionKind
Exclude certain code patterns from being instrumented by arithmetic overflow sanitizers.
Definition LangOptions.h:325
@ None
Don't exclude any overflow patterns from sanitizers.
Definition LangOptions.h:327
@ AddUnsignedOverflowTest
if (a + b < a)
Definition LangOptions.h:333
@ NegUnsignedConst
-1UL
Definition LangOptions.h:335
@ All
Exclude all overflow patterns (below)
Definition LangOptions.h:329
@ AddSignedOverflowTest
if (a + b < a)
Definition LangOptions.h:331
@ PostDecrInWhile
while (count–)
Definition LangOptions.h:337
HLSLLangStd
Definition LangOptions.h:177
@ HLSL_202x
Definition LangOptions.h:184
@ HLSL_Unset
Definition LangOptions.h:178
@ HLSL_2018
Definition LangOptions.h:182
@ HLSL_2016
Definition LangOptions.h:180
@ HLSL_2021
Definition LangOptions.h:183
@ HLSL_202y
Definition LangOptions.h:185
@ HLSL_2017
Definition LangOptions.h:181
@ HLSL_2015
Definition LangOptions.h:179
clang::Visibility Visibility
Definition LangOptions.h:77
DefaultVisiblityExportMapping
Definition LangOptions.h:340
@ None
Definition LangOptions.h:341
@ Explicit
map only explicit default visibilities to exported
Definition LangOptions.h:343
@ All
map all default visibilities to exported
Definition LangOptions.h:345
SYCLMajorVersion
Definition LangOptions.h:168
@ SYCL_2020
Definition LangOptions.h:171
@ SYCL_None
Definition LangOptions.h:169
@ SYCL_Default
Definition LangOptions.h:174
@ SYCL_2017
Definition LangOptions.h:170
CompatibilityKind
For ASTs produced with different option value, signifies their level of compatibility.
Definition LangOptions.h:83
@ NotCompatible
Does affect the construction of the AST in a way that does prevent module interoperability.
Definition LangOptions.h:86
@ Compatible
Does affect the construction of the AST in a way that doesn't prevent interoperability (that is,...
Definition LangOptions.h:90
@ Benign
Does not affect the construction of the AST in any way (that is, the value can be different between a...
Definition LangOptions.h:94
FPExceptionModeKind
Possible floating point exception behavior.
Definition LangOptions.h:228
@ FPE_Default
Used internally to represent initial unspecified value.
Definition LangOptions.h:236
@ FPE_Strict
Strictly preserve the floating-point exception semantics.
Definition LangOptions.h:234
@ FPE_MayTrap
Transformations do not cause new exceptions but may hide some.
Definition LangOptions.h:232
@ FPE_Ignore
Assume that floating-point exceptions are masked.
Definition LangOptions.h:230
clang::CFBranchLabelSchemeKind CFBranchLabelSchemeKind
Definition LangOptions.h:79
friend class CompilerInvocation
Definition LangOptions.h:73
VisibilityFromDLLStorageClassKinds
Definition LangOptions.h:359
@ Keep
Keep the IR-gen assigned visibility.
Definition LangOptions.h:361
@ Protected
Override the IR-gen assigned visibility with protected visibility.
Definition LangOptions.h:367
@ Hidden
Override the IR-gen assigned visibility with hidden visibility.
Definition LangOptions.h:365
AddrSpaceMapMangling
Definition LangOptions.h:150
@ ASMM_On
Definition LangOptions.h:150
@ ASMM_Off
Definition LangOptions.h:150
@ ASMM_Target
Definition LangOptions.h:150
ClangABI
Clang versions with different platform ABI conformance.
Definition LangOptions.h:189
RegisterStaticDestructorsKind
Controls which variables have static destructors registered.
Definition LangOptions.h:415
@ ThreadLocal
Register static destructors only for thread-local variables.
Definition LangOptions.h:419
ExcessPrecisionKind
Definition LangOptions.h:261
@ FPP_Fast
Definition LangOptions.h:261
@ FPP_None
Definition LangOptions.h:261
@ FPP_Standard
Definition LangOptions.h:261
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition LangOptions.h:452
bool NoWasmOpt
Definition LangOptions.h:578
bool isSignReturnAddressWithAKey() const
Check if return address signing uses AKey.
Definition LangOptions.h:719
void resetNonModularOptions()
Reset all of the options that are not considered when building a module.
std::vector< std::string > OverflowPatternExclusionValues
Definition LangOptions.h:552
std::optional< TargetCXXABI::Kind > CXXABI
C++ ABI to compile with, if specified by the frontend through -fc++-abi=.
Definition LangOptions.h:540
bool AtomicFineGrainedMemory
Definition LangOptions.h:583
bool isCompatibleWithMSVC(MSVCMajorVersion MajorVersion) const
Definition LangOptions.h:645
std::vector< std::string > NoBuiltinFuncs
A list of all -fno-builtin-* function names (e.g., memset).
Definition LangOptions.h:519
std::string ModuleName
The module currently being compiled as specified by -fmodule-name.
Definition LangOptions.h:500
std::vector< std::string > XRayNeverInstrumentFiles
Paths to the XRay "never instrument" files specifying which objects (files, functions,...
Definition LangOptions.h:476
FPExceptionModeKind getDefaultExceptionMode() const
Definition LangOptions.h:775
bool requiresStrictPrototypes() const
Returns true if functions without prototypes or functions with an identifier list (aka K&R C function...
Definition LangOptions.h:694
bool isImplicitIntAllowed() const
Returns true if implicit int is supported at all.
Definition LangOptions.h:711
bool isCompilingModuleImplementation() const
Are we compiling a module implementation?
Definition LangOptions.h:625
bool isNoBuiltinFunc(StringRef Name) const
Is this a libc/libm function that is no longer recognized as a builtin because a -fno-builtin-* optio...
clang::ObjCRuntime ObjCRuntime
Definition LangOptions.h:487
CoreFoundationABI CFRuntime
Definition LangOptions.h:489
std::string getOpenCLVersionString() const
Return the OpenCL C or C++ for OpenCL language name and version as a string.
unsigned OverflowPatternExclusionMask
Which overflow patterns should be excluded from sanitizer instrumentation.
Definition LangOptions.h:550
bool IsHeaderFile
Indicates whether the front-end is explicitly told that the input is a header file (i....
Definition LangOptions.h:544
bool hasDefaultVisibilityExportMapping() const
Definition LangOptions.h:730
SanitizerSet Sanitize
Set of enabled sanitizers.
Definition LangOptions.h:458
std::optional< llvm::AllocTokenMode > AllocTokenMode
The allocation token mode.
Definition LangOptions.h:591
CommentOptions CommentOpts
Options for parsing comments.
Definition LangOptions.h:516
bool isExplicitDefaultVisibilityExportMapping() const
Definition LangOptions.h:735
std::vector< std::string > XRayAlwaysInstrumentFiles
Paths to the XRay "always instrument" files specifying which objects (files, functions,...
Definition LangOptions.h:470
bool hasAtExit() const
Returns true if the language supports calling the 'atexit' function.
Definition LangOptions.h:705
bool trackLocalOwningModule() const
Do we need to track the owning module for a local declaration?
Definition LangOptions.h:630
bool isAllDefaultVisibilityExportMapping() const
Definition LangOptions.h:740
bool isSubscriptPointerArithmetic() const
Definition LangOptions.h:638
bool UseTargetPathSeparator
Indicates whether to use target's platform-specific file separator when FILE macro is used and when c...
Definition LangOptions.h:563
bool isSignedOverflowDefined() const
Definition LangOptions.h:634
bool hasDefaultGlobalAllocationFunctionVisibility() const
Definition LangOptions.h:750
bool AtomicIgnoreDenormalMode
Definition LangOptions.h:584
bool hasGlobalAllocationFunctionVisibility() const
Definition LangOptions.h:745
VersionTuple getOpenCLVersionTuple() const
Return the OpenCL C or C++ version as a VersionTuple.
bool implicitFunctionsAllowed() const
Returns true if implicit function declarations are allowed in the current language mode.
Definition LangOptions.h:700
bool hasSignReturnAddress() const
Check if return address signing is enabled.
Definition LangOptions.h:714
static void setLangDefaults(LangOptions &Opts, Language Lang, const llvm::Triple &T, std::vector< std::string > &Includes, LangStandard::Kind LangStd=LangStandard::lang_unspecified)
Set language defaults for the given input language and language standard in the given LangOptions obj...
bool isCompatibleWithMSVC() const
Definition LangOptions.h:643
bool assumeFunctionsAreConvergent() const
Definition LangOptions.h:670
std::string OMPHostIRFile
Name of the IR file that contains the result of the OpenMP target host code generation.
Definition LangOptions.h:530
bool allowsNonTrivialObjCLifetimeQualifiers() const
True if any ObjC types may have non-trivial lifetime qualifiers.
Definition LangOptions.h:666
bool isOverflowPatternExcluded(OverflowPatternExclusionKind Kind) const
Definition LangOptions.h:649
bool allowArrayReturnTypes() const
Definition LangOptions.h:765
std::string OverflowHandler
The name of the handler function to be called when -ftrapv is specified.
Definition LangOptions.h:497
std::string HLSLRootSigOverride
The HLSL root signature that will be used to overide the root signature used for the shader entry poi...
Definition LangOptions.h:574
bool CheckNew
Definition LangOptions.h:567
bool hasHiddenGlobalAllocationFunctionVisibility() const
Definition LangOptions.h:760
std::string RandstructSeed
The seed used by the randomize structure layout feature.
Definition LangOptions.h:555
std::map< std::string, std::string, std::greater< std::string > > MacroPrefixMap
A prefix map for FILE, BASE_FILE and __builtin_FILE().
Definition LangOptions.h:522
std::vector< std::string > ProfileListFiles
Paths to special case list files specifying which entities (files, functions) should or should not be...
Definition LangOptions.h:485
void remapPathPrefix(SmallVectorImpl< char > &Path) const
Remap path prefix according to -fmacro-prefix-path option.
bool isTargetDevice() const
True when compiling for an offloading target device.
Definition LangOptions.h:783
std::optional< uint64_t > AllocTokenMax
Maximum number of allocation tokens (0 = target SIZE_MAX), nullopt if none set (use target SIZE_MAX).
Definition LangOptions.h:588
bool hasProtectedGlobalAllocationFunctionVisibility() const
Definition LangOptions.h:755
std::optional< uint32_t > getCPlusPlusLangStd() const
Returns the most applicable C++ standard-compliant language version code.
LangStandard::Kind LangStd
The used language standard.
Definition LangOptions.h:455
llvm::dxbc::RootSignatureVersion HLSLRootSigVer
The HLSL root signature version for dxil.
Definition LangOptions.h:570
std::optional< uint32_t > getCLangStd() const
Returns the most applicable C standard-compliant language version code.
RoundingMode getDefaultRoundingMode() const
Definition LangOptions.h:770
bool isCompilingModule() const
Are we compiling a module?
Definition LangOptions.h:620
bool isImplicitIntRequired() const
Returns true if implicit int is part of the language requirements.
Definition LangOptions.h:708
bool isSignReturnAddressScopeAll() const
Check if leaf functions are also signed.
Definition LangOptions.h:724
bool isSYCL() const
Definition LangOptions.h:728
std::string ObjCConstantStringClass
Definition LangOptions.h:491
std::string CUID
The user provided compilation unit ID, if non-empty.
Definition LangOptions.h:536
unsigned getOpenCLCompatibleVersion() const
Return the OpenCL version that kernel language is compatible with.
GPUDefaultStreamKind GPUDefaultStream
The default stream kind used for HIP kernel launching.
Definition LangOptions.h:547
bool AtomicRemoteMemory
Atomic code-generation options.
Definition LangOptions.h:582
bool threadPrivateMemoryAtomicsAreUndefined() const
Return true if atomicrmw operations targeting allocations in private memory are undefined.
Definition LangOptions.h:676
std::vector< std::string > XRayAttrListFiles
Paths to the XRay attribute list files, specifying which objects (files, functions,...
Definition LangOptions.h:481
bool SanitizeCoverage
Is at least one coverage instrumentation type enabled.
Definition LangOptions.h:460
std::vector< llvm::Triple > OMPTargetTriples
Triples of the OpenMP targets that the host code codegen should take into account in order to generat...
Definition LangOptions.h:526
std::vector< std::string > NoSanitizeFiles
Paths to files specifying which objects (files, functions, variables) should not be instrumented.
Definition LangOptions.h:464
std::string CurrentModule
The name of the current module, of which the main source file is a part.
Definition LangOptions.h:507
std::vector< std::string > ModuleFeatures
The names of any features to enable in module 'requires' decls in addition to the hard-coded list in ...
Definition LangOptions.h:513
The basic abstraction for the target Objective-C runtime.
The JSON file list parser is used to communicate input to InstallAPI.
Language
The language for the input, used to select and validate the language standard and possible actions.
@ Result
The result type of a method or function.
const FunctionProtoType * T
MSVtorDispMode
In the Microsoft ABI, this controls the placement of virtual displacement members used to implement v...
Definition LangOptions.h:38
@ Never
Definition LangOptions.h:38
@ ForVFTable
Definition LangOptions.h:38
@ ForVBaseOverride
Definition LangOptions.h:38
ShaderStage
Shader programs run in specific pipeline stages.
Definition LangOptions.h:44
@ Pixel
Definition LangOptions.h:45
@ Invalid
Definition LangOptions.h:60
@ Library
Definition LangOptions.h:51
@ Hull
Definition LangOptions.h:48
@ Mesh
Definition LangOptions.h:58
@ Callable
Definition LangOptions.h:57
@ Intersection
Definition LangOptions.h:53
@ Compute
Definition LangOptions.h:50
@ Vertex
Definition LangOptions.h:46
@ RayGeneration
Definition LangOptions.h:52
@ Amplification
Definition LangOptions.h:59
@ ClosestHit
Definition LangOptions.h:55
@ Geometry
Definition LangOptions.h:47
@ Miss
Definition LangOptions.h:56
@ Domain
Definition LangOptions.h:49
@ AnyHit
Definition LangOptions.h:54
TranslationUnitKind
Describes the kind of translation unit being processed.
Definition LangOptions.h:1132
@ TU_Incremental
The translation unit is a is a complete translation unit that we might incrementally extend later.
Definition LangOptions.h:1145
@ TU_Complete
The translation unit is a complete translation unit.
Definition LangOptions.h:1134
@ TU_ClangModule
The translation unit is a clang module.
Definition LangOptions.h:1141
@ TU_Prefix
The translation unit is a prefix to a translation unit, and is not complete.
Definition LangOptions.h:1138
PointerAuthenticationMode
Definition LangOptions.h:63
@ Strip
Definition LangOptions.h:65
@ SignAndStrip
Definition LangOptions.h:66
@ SignAndAuth
Definition LangOptions.h:67
AtomicOptionKind
Definition LangOptions.h:1076
@ FineGrainedMemory
Definition LangOptions.h:1078
@ IgnoreDenormalMode
Definition LangOptions.h:1079
@ LANGOPT_ATOMIC_OPTION_LAST
Definition LangOptions.h:1080
@ RemoteMemory
Definition LangOptions.h:1077
@ None
The alignment was not explicit in code.
Visibility
Describes the different kinds of visibility that a declaration may have.
AtomicOptions()
Definition LangOptions.h:1089
unsigned fine_grained_memory
Definition LangOptions.h:1086
void setOption(AtomicOptionKind Kind, bool Value)
Definition LangOptions.h:1109
LLVM_DUMP_METHOD void dump() const
Definition LangOptions.h:1124
unsigned ignore_denormal_mode
Definition LangOptions.h:1087
unsigned remote_memory
Definition LangOptions.h:1085
bool getOption(AtomicOptionKind Kind) const
Definition LangOptions.h:1097