clang
6.0.0
|
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that is accepted. More...
#include "clang/Basic/LangOptions.h"
Public Types | |
enum | GCMode { NonGC, GCOnly, HybridGC } |
enum | StackProtectorMode { SSPOff, SSPOn, SSPStrong, SSPReq } |
enum | SignedOverflowBehaviorTy { SOB_Undefined, SOB_Defined, SOB_Trapping } |
enum | CompilingModuleKind { CMK_None, CMK_ModuleMap, CMK_ModuleInterface } |
enum | PragmaMSPointersToMembersKind { PPTMK_BestCase, PPTMK_FullGeneralitySingleInheritance, PPTMK_FullGeneralityMultipleInheritance, PPTMK_FullGeneralityVirtualInheritance } |
enum | DefaultCallingConvention { DCC_None, DCC_CDecl, DCC_FastCall, DCC_StdCall, DCC_VectorCall, DCC_RegCall } |
enum | AddrSpaceMapMangling { ASMM_Target, ASMM_On, ASMM_Off } |
enum | MSVCMajorVersion { MSVC2010 = 16, MSVC2012 = 17, MSVC2013 = 18, MSVC2015 = 19 } |
enum | FPContractModeKind { FPC_Off, FPC_On, FPC_Fast } |
typedef clang::Visibility | Visibility |
Public Member Functions | |
LangOptions () | |
bool | isCompilingModule () const |
Are we compiling a module interface (.cppm or module map)? More... | |
bool | trackLocalOwningModule () const |
Do we need to track the owning module for a local declaration? More... | |
bool | isSignedOverflowDefined () const |
bool | isSubscriptPointerArithmetic () const |
bool | isCompatibleWithMSVC (MSVCMajorVersion MajorVersion) const |
void | resetNonModularOptions () |
Reset all of the options that are not considered when building a module. More... | |
bool | isNoBuiltinFunc (StringRef Name) const |
Is this a libc/libm function that is no longer recognized as a builtin because a -fno-builtin-* option has been specified? More... | |
bool | allowsNonTrivialObjCLifetimeQualifiers () const |
True if any ObjC types may have non-trivial lifetime qualifiers. More... | |
bool | assumeFunctionsAreConvergent () const |
Public Attributes | |
SanitizerSet | Sanitize |
Set of enabled sanitizers. More... | |
std::vector< std::string > | SanitizerBlacklistFiles |
Paths to blacklist files specifying which objects (files, functions, variables) should not be instrumented. More... | |
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. More... | |
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. More... | |
clang::ObjCRuntime | ObjCRuntime |
std::string | ObjCConstantStringClass |
std::string | OverflowHandler |
The name of the handler function to be called when -ftrapv is specified. More... | |
std::string | CurrentModule |
The name of the current module, of which the main source file is a part. More... | |
std::vector< std::string > | ModuleFeatures |
The names of any features to enable in module 'requires' decls in addition to the hard-coded list in Module.cpp and the target features. More... | |
CommentOptions | CommentOpts |
Options for parsing comments. More... | |
std::vector< std::string > | NoBuiltinFuncs |
A list of all -fno-builtin-* function names (e.g., memset). More... | |
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. More... | |
std::string | OMPHostIRFile |
Name of the IR file that contains the result of the OpenMP target host code generation. More... | |
bool | IsHeaderFile |
Indicates whether the front-end is explicitly told that the input is a header file (i.e. More... | |
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that is accepted.
Definition at line 48 of file LangOptions.h.
Definition at line 50 of file LangOptions.h.
Enumerator | |
---|---|
ASMM_Target | |
ASMM_On | |
ASMM_Off |
Definition at line 84 of file LangOptions.h.
Enumerator | |
---|---|
CMK_None | Not compiling a module interface at all. |
CMK_ModuleMap | Compiling a module from a module map. |
CMK_ModuleInterface | Compiling a C++ modules TS module interface unit. |
Definition at line 62 of file LangOptions.h.
Enumerator | |
---|---|
DCC_None | |
DCC_CDecl | |
DCC_FastCall | |
DCC_StdCall | |
DCC_VectorCall | |
DCC_RegCall |
Definition at line 75 of file LangOptions.h.
Enumerator | |
---|---|
FPC_Off | |
FPC_On | |
FPC_Fast |
Definition at line 93 of file LangOptions.h.
Enumerator | |
---|---|
NonGC | |
GCOnly | |
HybridGC |
Definition at line 52 of file LangOptions.h.
Enumerator | |
---|---|
MSVC2010 | |
MSVC2012 | |
MSVC2013 | |
MSVC2015 |
Definition at line 86 of file LangOptions.h.
Enumerator | |
---|---|
PPTMK_BestCase | |
PPTMK_FullGeneralitySingleInheritance | |
PPTMK_FullGeneralityMultipleInheritance | |
PPTMK_FullGeneralityVirtualInheritance |
Definition at line 68 of file LangOptions.h.
Enumerator | |
---|---|
SOB_Undefined | |
SOB_Defined | |
SOB_Trapping |
Definition at line 55 of file LangOptions.h.
Enumerator | |
---|---|
SSPOff | |
SSPOn | |
SSPStrong | |
SSPReq |
Definition at line 53 of file LangOptions.h.
LangOptions::LangOptions | ( | ) |
Definition at line 18 of file LangOptions.cpp.
|
inline |
True if any ObjC types may have non-trivial lifetime qualifiers.
Definition at line 198 of file LangOptions.h.
Referenced by DiagnoseBadFunctionCast(), and TryReinterpretCast().
|
inline |
Definition at line 202 of file LangOptions.h.
References clang::OpenCL.
|
inline |
Definition at line 185 of file LangOptions.h.
Referenced by AddKeyword(), clang::TextDiagnostic::emitDiagnosticLoc(), and clang::targets::WindowsTargetInfo< X86_32TargetInfo >::getVisualStudioDefines().
|
inline |
Are we compiling a module interface (.cppm or module map)?
Definition at line 167 of file LangOptions.h.
References clang::CMK_None.
Referenced by clang::ModuleMap::addHeader(), clang::ModuleMap::diagnoseHeaderInclusion(), clang::PCHGenerator::HandleTranslationUnit(), clang::ASTUnit::isModuleFile(), and isTargetEnvironment().
bool LangOptions::isNoBuiltinFunc | ( | StringRef | Name | ) | const |
Is this a libc/libm function that is no longer recognized as a builtin because a -fno-builtin-* option has been specified?
Definition at line 41 of file LangOptions.cpp.
References NoBuiltinFuncs.
|
inline |
Definition at line 176 of file LangOptions.h.
Referenced by DiagnoseBadShiftValues(), emitPointerArithmetic(), and tryEmitFMulAdd().
|
inline |
Definition at line 180 of file LangOptions.h.
References clang::ObjCRuntime::isSubscriptPointerArithmetic().
void LangOptions::resetNonModularOptions | ( | ) |
Reset all of the options that are not considered when building a module.
Definition at line 25 of file LangOptions.cpp.
References CurrentModule, IsHeaderFile, SanitizerBlacklistFiles, XRayAlwaysInstrumentFiles, and XRayNeverInstrumentFiles.
|
inline |
Do we need to track the owning module for a local declaration?
Definition at line 172 of file LangOptions.h.
Referenced by clang::Decl::hasLocalOwningModuleStorage().
CommentOptions clang::LangOptions::CommentOpts |
Options for parsing comments.
Definition at line 140 of file LangOptions.h.
Referenced by clang::Sema::ActOnComment(), checkLanguageOptions(), clang::CompilerInvocation::CreateFromArgs(), and clang::ASTContext::getRawCommentForDeclNoCache().
std::string clang::LangOptions::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.
Definition at line 131 of file LangOptions.h.
Referenced by clang::Preprocessor::checkModuleIsAvailable(), clang::FrontendAction::getCurrentModule(), clang::Preprocessor::getModuleForLocation(), clang::PCHGenerator::HandleTranslationUnit(), clang::Sema::hasVisibleMemberSpecialization(), isTargetEnvironment(), clang::CompilerInstance::loadModule(), ParseLangArgs(), prepareToBuildModule(), and resetNonModularOptions().
bool clang::LangOptions::IsHeaderFile |
Indicates whether the front-end is explicitly told that the input is a header file (i.e.
-x c-header).
Definition at line 155 of file LangOptions.h.
Referenced by clang::CompilerInvocation::CreateFromArgs(), EvaluateHasIncludeNext(), and resetNonModularOptions().
std::vector<std::string> clang::LangOptions::ModuleFeatures |
The names of any features to enable in module 'requires' decls in addition to the hard-coded list in Module.cpp and the target features.
This list is sorted.
Definition at line 137 of file LangOptions.h.
Referenced by checkLanguageOptions(), hasFeature(), and ParseLangArgs().
std::vector<std::string> clang::LangOptions::NoBuiltinFuncs |
A list of all -fno-builtin-* function names (e.g., memset).
Definition at line 143 of file LangOptions.h.
Referenced by isNoBuiltinFunc(), and ParseLangArgs().
std::string clang::LangOptions::ObjCConstantStringClass |
Definition at line 119 of file LangOptions.h.
Referenced by GetConstantStringEntry(), ParseLangArgs(), and SymbolNameForMethod().
clang::ObjCRuntime clang::LangOptions::ObjCRuntime |
Definition at line 117 of file LangOptions.h.
Referenced by clang::Decl::canBeWeakImported(), clang::Sema::CheckImplementationIvars(), checkLanguageOptions(), clang::RewriteObjCAction::CreateASTConsumer(), clang::CodeGen::CreateGNUObjCRuntime(), getObjCPersonality(), getObjCXXPersonality(), HasFeature(), hasUnwindExceptions(), ParseLangArgs(), SymbolNameForMethod(), UseOptimizedSetter(), and clang::CodeGen::CodeGenModule::~CodeGenModule().
std::string clang::LangOptions::OMPHostIRFile |
Name of the IR file that contains the result of the OpenMP target host code generation.
Definition at line 151 of file LangOptions.h.
Referenced by clang::CodeGen::loadOffloadInfoMetadata(), and ParseLangArgs().
std::vector<llvm::Triple> clang::LangOptions::OMPTargetTriples |
Triples of the OpenMP targets that the host code codegen should take into account in order to generate accurate offloading descriptors.
Definition at line 147 of file LangOptions.h.
Referenced by clang::CodeGen::createOffloadingBinaryDescriptorRegistration(), emitCommonOMPTargetDirective(), and ParseLangArgs().
std::string clang::LangOptions::OverflowHandler |
The name of the handler function to be called when -ftrapv is specified.
If none is specified, abort (GCC-compatible behaviour).
Definition at line 125 of file LangOptions.h.
Referenced by ParseLangArgs().
SanitizerSet clang::LangOptions::Sanitize |
Set of enabled sanitizers.
Definition at line 101 of file LangOptions.h.
Referenced by checkLanguageOptions(), clang::CompilerInvocation::CreateFromArgs(), clang::CodeGen::CodeGenModule::CreateFunctionTypeMetadata(), clang::CodeGen::SanitizerMetadata::disableSanitizerForGlobal(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), HasFeature(), clang::CodeGen::CodeGenModule::isInSanitizerBlacklist(), mapToLevel(), ParseLangArgs(), clang::CodeGen::SanitizerMetadata::reportGlobalToASan(), and shouldEmitLifetimeMarkers().
std::vector<std::string> clang::LangOptions::SanitizerBlacklistFiles |
Paths to blacklist files specifying which objects (files, functions, variables) should not be instrumented.
Definition at line 105 of file LangOptions.h.
Referenced by ParseLangArgs(), and resetNonModularOptions().
std::vector<std::string> clang::LangOptions::XRayAlwaysInstrumentFiles |
Paths to the XRay "always instrument" files specifying which objects (files, functions, variables) should be imbued with the XRay "always instrument" attribute.
Definition at line 110 of file LangOptions.h.
Referenced by ParseLangArgs(), and resetNonModularOptions().
std::vector<std::string> clang::LangOptions::XRayNeverInstrumentFiles |
Paths to the XRay "never instrument" files specifying which objects (files, functions, variables) should be imbued with the XRay "never instrument" attribute.
Definition at line 115 of file LangOptions.h.
Referenced by ParseLangArgs(), and resetNonModularOptions().