class LangOptions
Declaration
class LangOptions : public LangOptionsBase { /* full declaration omitted */ };
Description
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that is accepted.
Declared at: clang/include/clang/Basic/LangOptions.h:78
Inherits from: LangOptionsBase
Member Variables
- public LangStandard::Kind LangStd
- The used language standard.
- public clang::SanitizerSet Sanitize
- Set of enabled sanitizers.
- public bool SanitizeCoverage = false
- Is at least one coverage instrumentation type enabled.
- public std::vector<std::string> NoSanitizeFiles
- Paths to files specifying which objects (files, functions, variables) should not be instrumented.
- public std::vector<std::string> XRayAlwaysInstrumentFiles
- Paths to the XRay "always instrument" files specifying which objects (files, functions, variables) should be imbued with the XRay "always instrument" attribute. WARNING: This is a deprecated field and will go away in the future.
- public std::vector<std::string> XRayNeverInstrumentFiles
- Paths to the XRay "never instrument" files specifying which objects (files, functions, variables) should be imbued with the XRay "never instrument" attribute. WARNING: This is a deprecated field and will go away in the future.
- public std::vector<std::string> XRayAttrListFiles
- Paths to the XRay attribute list files, specifying which objects (files, functions, variables) should be imbued with the appropriate XRay attribute(s).
- public std::vector<std::string> ProfileListFiles
- Paths to special case list files specifying which entities (files, functions) should or should not be instrumented.
- public clang::ObjCRuntime ObjCRuntime
- public clang::LangOptions::CoreFoundationABI CFRuntime = CoreFoundationABI::Unspecified
- public std::string ObjCConstantStringClass
- public std::string OverflowHandler
- If none is specified, abort (GCC-compatible behaviour).
- public std::string ModuleName
- The module currently being compiled as specified by -fmodule-name.
- public std::string CurrentModule
- The name of the current module, of which the main source file is a part. If CompilingModule is set, we are compiling the interface of this module, otherwise we are compiling an implementation file of it. This starts as ModuleName in case -fmodule-name is provided and changes during compilation to reflect the current module.
- public std::vector<std::string> ModuleFeatures
- This list is sorted.
- public clang::CommentOptions CommentOpts
- Options for parsing comments.
- public std::vector<std::string> NoBuiltinFuncs
- A list of all -fno-builtin-* function names (e.g., memset).
- public std::map<std::string, std::string, std::greater<std::string>> MacroPrefixMap
- A prefix map for __FILE__, __BASE_FILE__ and __builtin_FILE().
- public std::vector<llvm::Triple> OMPTargetTriples
- Triples of the OpenMP targets that the host code codegen should take into account in order to generate accurate offloading descriptors.
- public std::string OMPHostIRFile
- Name of the IR file that contains the result of the OpenMP target host code generation.
- public std::string CUID
- The user provided compilation unit ID, if non-empty. This is used to externalize static variables which is needed to support accessing static device variables in host code for single source offloading languages like CUDA/HIP.
- public llvm::Optional<TargetCXXABI::Kind> CXXABI
- C++ ABI to compile with, if specified by the frontend through -fc++-abi=. This overrides the default ABI used by the target.
- public bool IsHeaderFile = false
- Indicates whether the front-end is explicitly told that the input is a header file (i.e. -x c-header).
- public clang::LangOptions::GPUDefaultStreamKind GPUDefaultStream
- The default stream kind used for HIP kernel launching.
- public std::string RandstructSeed
- The seed used by the randomize structure layout feature.
- public bool UseTargetPathSeparator = false
- The plaform-specific path separator is the backslash( \ ) for Windows and forward slash (/) elsewhere.
Inherited from LangOptionsBase:
- public C99
- public C11
- public C17
- public C2x
- public MSVCCompat
- public Kernel
- public MicrosoftExt
- public AsmBlocks
- public Borland
- public CPlusPlus
- public CPlusPlus11
- public CPlusPlus14
- public CPlusPlus17
- public CPlusPlus20
- public CPlusPlus2b
- public ObjC
- public ObjCDefaultSynthProperties
- public EncodeExtendedBlockSig
- public EncodeCXXClassTemplateSpec
- public ObjCInferRelatedResultType
- public AppExt
- public Trigraphs
- public LineComment
- public Bool
- public Half
- public WChar
- public Char8
- public IEEE128
- public DeclSpecKeyword
- public DollarIdents
- public AsmPreprocessor
- public GNUMode
- public GNUKeywords
- public GNUCVersion
- public DisableKNRFunctions
- public Digraphs
- public HexFloats
- public CXXOperatorNames
- public AppleKext
- public PascalStrings
- public WritableStrings
- public ConstStrings
- public ConvergentFunctions
- public AltiVec
- public ZVector
- public Exceptions
- public ObjCExceptions
- public CXXExceptions
- public EHAsynch
- public IgnoreExceptions
- public ExternCNoUnwind
- public TraditionalCPP
- public RTTI
- public RTTIData
- public MSBitfields
- public Freestanding
- public NoBuiltin
- public NoMathBuiltin
- public GNUAsm
- public Coroutines
- public DllExportInlines
- public RelaxedTemplateTemplateArgs
- public ExperimentalLibrary
- public DoubleSquareBracketAttributes
- public RecoveryAST
- public RecoveryASTType
- public ThreadsafeStatics
- public POSIXThreads
- public Blocks
- public EmitAllDecls
- public MathErrno
- public HeinousExtensions
- public Modules
- public ModulesTS
- public CPlusPlusModules
- public CompilingPCH
- public BuildingPCHWithObjectFile
- public CacheGeneratedPCH
- public PCHInstantiateTemplates
- public ModulesDeclUse
- public ModulesSearchAll
- public ModulesStrictDeclUse
- public ModulesErrorRecovery
- public ImplicitModules
- public ModulesLocalVisibility
- public Optimize
- public OptimizeSize
- public Static
- public PackStruct
- public MaxTypeAlign
- public AlignDouble
- public DoubleSize
- public LongDoubleSize
- public PPCIEEELongDouble
- public EnableAIXExtendedAltivecABI
- public EnableAIXQuadwordAtomicsABI
- public PICLevel
- public PIE
- public ROPI
- public RWPI
- public GNUInline
- public NoInlineDefine
- public Deprecated
- public FastMath
- public FiniteMathOnly
- public UnsafeFPMath
- public ProtectParens
- public AllowFPReassoc
- public NoHonorNaNs
- public NoHonorInfs
- public NoSignedZero
- public AllowRecip
- public ApproxFunc
- public ObjCGCBitmapPrint
- public AccessControl
- public CharIsSigned
- public WCharSize
- public WCharIsSigned
- public ShortEnums
- public OpenCL
- public OpenCLVersion
- public OpenCLCPlusPlus
- public OpenCLCPlusPlusVersion
- public OpenCLGenericAddressSpace
- public OpenCLPipes
- public NativeHalfType
- public NativeHalfArgsAndReturns
- public HalfArgsAndReturns
- public CUDA
- public HIP
- public OpenMP
- public OpenMPExtensions
- public OpenMPSimd
- public OpenMPUseTLS
- public OpenMPIsDevice
- public OpenMPCUDAMode
- public OpenMPIRBuilder
- public OpenMPCUDAForceFullRuntime
- public OpenMPCUDANumSMs
- public OpenMPCUDABlocksPerSM
- public OpenMPCUDAReductionBufNum
- public OpenMPTargetDebug
- public OpenMPOptimisticCollapse
- public OpenMPThreadSubscription
- public OpenMPTeamSubscription
- public OpenMPNoThreadState
- public OpenMPOffloadMandatory
- public NoGPULib
- public RenderScript
- public HLSL
- public CUDAIsDevice
- public CUDAAllowVariadicFunctions
- public CUDAHostDeviceConstexpr
- public CUDADeviceApproxTranscendentals
- public GPURelocatableDeviceCode
- public GPUAllowDeviceInit
- public GPUMaxThreadsPerBlock
- public GPUDeferDiag
- public GPUExcludeWrongSideOverloads
- public OffloadingNewDriver
- public SYCLIsDevice
- public SYCLIsHost
- public HIPUseNewLaunchAPI
- public SizedDeallocation
- public AlignedAllocation
- public AlignedAllocationUnavailable
- public NewAlignOverride
- public ModulesCodegen
- public ModulesDebugInfo
- public ElideConstructors
- public DumpRecordLayouts
- public DumpRecordLayoutsSimple
- public DumpRecordLayoutsCanonical
- public DumpRecordLayoutsComplete
- public DumpVTableLayouts
- public NoConstantCFStrings
- public InlineVisibilityHidden
- public IgnoreXCOFFVisibility
- public VisibilityInlinesHiddenStaticLocalVar
- public GlobalAllocationFunctionVisibilityHidden
- public NewInfallible
- public ParseUnknownAnytype
- public DebuggerSupport
- public DebuggerCastResultToId
- public DebuggerObjCLiteral
- public SpellChecking
- public SinglePrecisionConstants
- public FastRelaxedMath
- public CLNoSignedZero
- public CLUnsafeMath
- public CLFiniteMathOnly
- public ExpStrictFP
- public RoundingMath
- public NoBitFieldTypeAlign
- public HexagonQdsp6Compat
- public ObjCAutoRefCount
- public ObjCWeakRuntime
- public ObjCWeak
- public ObjCSubscriptingLegacyRuntime
- public CompatibilityQualifiedIdBlockParamTypeChecking
- public ObjCDisableDirectMethodsForTesting
- public CFProtectionBranch
- public FakeAddressSpaceMap
- public IncludeDefaultHeader
- public DeclareOpenCLBuiltins
- public DelayedTemplateParsing
- public BlocksRuntimeOptional
- public CompleteMemberPointers
- public SetVisibilityForExternDecls
- public VisibilityFromDLLStorageClass
- public SemanticInterposition
- public HalfNoSemanticInterposition
- public TrivialAutoVarInitStopAfter
- public ArrowDepth
- public InstantiationDepth
- public ConstexprCallDepth
- public ConstexprStepLimit
- public EnableNewConstInterp
- public BracketDepth
- public NumLargeByValueCopy
- public MSCompatibilityVersion
- public ApplePragmaPack
- public XLPragmaPack
- public RetainCommentsFromSystemHeaders
- public SanitizeAddressFieldPadding
- public Cmse
- public XRayInstrument
- public XRayAlwaysEmitCustomEvents
- public XRayAlwaysEmitTypedEvents
- public ForceEmitVTables
- public AllowEditorPlaceholders
- public FunctionAlignment
- public LoopAlignment
- public FixedPoint
- public PaddingOnUnsignedFixedPoint
- public RegisterStaticDestructors
- public MatrixTypes
- public StrictFlexArrays
- public MaxTokens
- public BranchTargetEnforcement
- public SpeculativeLoadHardening
- public RelativeCXXABIVTables
- public VScaleMin
- public VScaleMax
- public FuchsiaAPILevel
- public MaxBitIntWidth
- protected LaxVectorConversions
- protected AltivecSrcCompat
- protected ExceptionHandling
- protected CompilingModule
- protected MSPointerToMemberRepresentationMethod
- protected DefaultCallingConv
- protected HLSLVersion
- protected SYCLVersion
- protected DefaultVisibilityExportMapping
- protected DefaultFPContractMode
- protected FPExceptionMode
- protected FPEvalMethod
- protected AddressSpaceMapMangling
- protected GC
- protected ValueVisibilityMode
- protected TypeVisibilityMode
- protected DLLExportVisibility
- protected NoDLLStorageClassVisibility
- protected ExternDeclDLLImportVisibility
- protected ExternDeclNoDLLStorageClassVisibility
- protected StackProtector
- protected TrivialAutoVarInit
- protected SignedOverflowBehavior
- protected ThreadModel
- protected VtorDispMode
- protected ClangABICompat
- protected SignReturnAddressScope
- protected SignReturnAddressKey
- protected ExtendIntArgs
Method Overview
- public LangOptions()
- public bool allowsNonTrivialObjCLifetimeQualifiers() const
- public bool assumeFunctionsAreConvergent() const
- public clang::LangOptions::FPExceptionModeKind getDefaultExceptionMode() const
- public clang::LangOptions::RoundingMode getDefaultRoundingMode() const
- public unsigned int getOpenCLCompatibleVersion() const
- public std::string getOpenCLVersionString() const
- public llvm::VersionTuple getOpenCLVersionTuple() const
- public bool hasDWARFExceptions() const
- public bool hasDefaultVisibilityExportMapping() const
- public bool hasSEHExceptions() const
- public bool hasSignReturnAddress() const
- public bool hasSjLjExceptions() const
- public bool hasWasmExceptions() const
- public bool implicitFunctionsAllowed() const
- public bool isAllDefaultVisibilityExportMapping() const
- public bool isCompatibleWithMSVC(clang::LangOptions::MSVCMajorVersion MajorVersion) const
- public bool isCompilingModule() const
- public bool isExplicitDefaultVisibilityExportMapping() const
- public bool isImplicitIntAllowed() const
- public bool isImplicitIntRequired() const
- public bool isNoBuiltinFunc(llvm::StringRef Name) const
- public bool isSYCL() const
- public bool isSignReturnAddressScopeAll() const
- public bool isSignReturnAddressWithAKey() const
- public bool isSignedOverflowDefined() const
- public bool isSubscriptPointerArithmetic() const
- public void remapPathPrefix(SmallVectorImpl<char> & Path) const
- public bool requiresStrictPrototypes() const
- public void resetNonModularOptions()
- public static void setLangDefaults(clang::LangOptions & Opts, clang::Language Lang, const llvm::Triple & T, std::vector<std::string> & Includes, LangStandard::Kind LangStd = LangStandard::lang_unspecified)
- public bool trackLocalOwningModule() const
Methods
¶LangOptions()
LangOptions()
Declared at: clang/include/clang/Basic/LangOptions.h:470
¶bool allowsNonTrivialObjCLifetimeQualifiers()
const
bool allowsNonTrivialObjCLifetimeQualifiers()
const
Description
True if any ObjC types may have non-trivial lifetime qualifiers.
Declared at: clang/include/clang/Basic/LangOptions.h:525
¶bool assumeFunctionsAreConvergent() const
bool assumeFunctionsAreConvergent() const
Declared at: clang/include/clang/Basic/LangOptions.h:529
¶clang::LangOptions::FPExceptionModeKind
getDefaultExceptionMode() const
clang::LangOptions::FPExceptionModeKind
getDefaultExceptionMode() const
Declared at: clang/include/clang/Basic/LangOptions.h:617
¶clang::LangOptions::RoundingMode
getDefaultRoundingMode() const
clang::LangOptions::RoundingMode
getDefaultRoundingMode() const
Declared at: clang/include/clang/Basic/LangOptions.h:612
¶unsigned int getOpenCLCompatibleVersion() const
unsigned int getOpenCLCompatibleVersion() const
Description
Return the OpenCL version that kernel language is compatible with
Declared at: clang/include/clang/Basic/LangOptions.h:537
¶std::string getOpenCLVersionString() const
std::string getOpenCLVersionString() const
Description
Return the OpenCL C or C++ for OpenCL language name and version as a string.
Declared at: clang/include/clang/Basic/LangOptions.h:541
¶llvm::VersionTuple getOpenCLVersionTuple() const
llvm::VersionTuple getOpenCLVersionTuple() const
Description
Return the OpenCL C or C++ version as a VersionTuple.
Declared at: clang/include/clang/Basic/LangOptions.h:534
¶bool hasDWARFExceptions() const
bool hasDWARFExceptions() const
Declared at: clang/include/clang/Basic/LangOptions.h:584
¶bool hasDefaultVisibilityExportMapping() const
bool hasDefaultVisibilityExportMapping() const
Declared at: clang/include/clang/Basic/LangOptions.h:594
¶bool hasSEHExceptions() const
bool hasSEHExceptions() const
Declared at: clang/include/clang/Basic/LangOptions.h:580
¶bool hasSignReturnAddress() const
bool hasSignReturnAddress() const
Description
Check if return address signing is enabled.
Declared at: clang/include/clang/Basic/LangOptions.h:562
¶bool hasSjLjExceptions() const
bool hasSjLjExceptions() const
Declared at: clang/include/clang/Basic/LangOptions.h:576
¶bool hasWasmExceptions() const
bool hasWasmExceptions() const
Declared at: clang/include/clang/Basic/LangOptions.h:588
¶bool implicitFunctionsAllowed() const
bool implicitFunctionsAllowed() const
Description
Returns true if implicit function declarations are allowed in the current language mode.
Declared at: clang/include/clang/Basic/LangOptions.h:551
¶bool isAllDefaultVisibilityExportMapping() const
bool isAllDefaultVisibilityExportMapping() const
Declared at: clang/include/clang/Basic/LangOptions.h:604
¶bool isCompatibleWithMSVC(
clang::LangOptions::MSVCMajorVersion
MajorVersion) const
bool isCompatibleWithMSVC(
clang::LangOptions::MSVCMajorVersion
MajorVersion) const
Declared at: clang/include/clang/Basic/LangOptions.h:512
Parameters
- clang::LangOptions::MSVCMajorVersion MajorVersion
¶bool isCompilingModule() const
bool isCompilingModule() const
Description
Are we compiling a module interface (.cppm or module map)?
Declared at: clang/include/clang/Basic/LangOptions.h:494
¶bool isExplicitDefaultVisibilityExportMapping()
const
bool isExplicitDefaultVisibilityExportMapping()
const
Declared at: clang/include/clang/Basic/LangOptions.h:599
¶bool isImplicitIntAllowed() const
bool isImplicitIntAllowed() const
Description
Returns true if implicit int is supported at all.
Declared at: clang/include/clang/Basic/LangOptions.h:559
¶bool isImplicitIntRequired() const
bool isImplicitIntRequired() const
Description
Returns true if implicit int is part of the language requirements.
Declared at: clang/include/clang/Basic/LangOptions.h:556
¶bool isNoBuiltinFunc(llvm::StringRef Name) const
bool isNoBuiltinFunc(llvm::StringRef Name) const
Description
Is this a libc/libm function that is no longer recognized as a builtin because a -fno-builtin-* option has been specified?
Declared at: clang/include/clang/Basic/LangOptions.h:522
Parameters
- llvm::StringRef Name
¶bool isSYCL() const
bool isSYCL() const
Declared at: clang/include/clang/Basic/LangOptions.h:592
¶bool isSignReturnAddressScopeAll() const
bool isSignReturnAddressScopeAll() const
Description
Check if leaf functions are also signed.
Declared at: clang/include/clang/Basic/LangOptions.h:572
¶bool isSignReturnAddressWithAKey() const
bool isSignReturnAddressWithAKey() const
Description
Check if return address signing uses AKey.
Declared at: clang/include/clang/Basic/LangOptions.h:567
¶bool isSignedOverflowDefined() const
bool isSignedOverflowDefined() const
Declared at: clang/include/clang/Basic/LangOptions.h:503
¶bool isSubscriptPointerArithmetic() const
bool isSubscriptPointerArithmetic() const
Declared at: clang/include/clang/Basic/LangOptions.h:507
¶void remapPathPrefix(
SmallVectorImpl<char>& Path) const
void remapPathPrefix(
SmallVectorImpl<char>& Path) const
Description
Remap path prefix according to -fmacro-prefix-path option.
Declared at: clang/include/clang/Basic/LangOptions.h:610
Parameters
- SmallVectorImpl<char>& Path
¶bool requiresStrictPrototypes() const
bool requiresStrictPrototypes() const
Description
Returns true if functions without prototypes or functions with an identifier list (aka K &R C functions) are not allowed.
Declared at: clang/include/clang/Basic/LangOptions.h:545
¶void resetNonModularOptions()
void resetNonModularOptions()
Description
Reset all of the options that are not considered when building a module.
Declared at: clang/include/clang/Basic/LangOptions.h:518
¶static void setLangDefaults(
clang::LangOptions& Opts,
clang::Language Lang,
const llvm::Triple& T,
std::vector<std::string>& Includes,
LangStandard::Kind LangStd =
LangStandard::lang_unspecified)
static void setLangDefaults(
clang::LangOptions& Opts,
clang::Language Lang,
const llvm::Triple& T,
std::vector<std::string>& Includes,
LangStandard::Kind LangStd =
LangStandard::lang_unspecified)
Description
Set language defaults for the given input language and language standard in the given LangOptions object.
Declared at: clang/include/clang/Basic/LangOptions.h:482
Parameters
- clang::LangOptions& Opts
- - The LangOptions object to set up.
- clang::Language Lang
- - The input language.
- const llvm::Triple& T
- - The target triple.
- std::vector<std::string>& Includes
- - If the language requires extra headers to be implicitly included, they will be appended to this list.
- LangStandard::Kind LangStd = LangStandard::lang_unspecified
- - The input language standard.
¶bool trackLocalOwningModule() const
bool trackLocalOwningModule() const
Description
Do we need to track the owning module for a local declaration?
Declared at: clang/include/clang/Basic/LangOptions.h:499