clang
10.0.0git
|
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 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 |
VersionTuple | getOpenCLVersionTuple () const |
Return the OpenCL C or C++ version as a VersionTuple. More... | |
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... | |
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). More... | |
clang::ObjCRuntime | ObjCRuntime |
CoreFoundationABI | CFRuntime = CoreFoundationABI::Unspecified |
std::string | ObjCConstantStringClass |
std::string | OverflowHandler |
The name of the handler function to be called when -ftrapv is specified. More... | |
std::string | ModuleName |
The module currently being compiled as specified by -fmodule-name. 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 = false |
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 53 of file LangOptions.h.
Definition at line 98 of file LangOptions.h.
Definition at line 55 of file LangOptions.h.
Enumerator | |
---|---|
ASMM_Target | |
ASMM_On | |
ASMM_Off |
Definition at line 109 of file LangOptions.h.
|
strong |
Clang versions with different platform ABI conformance.
Definition at line 123 of file LangOptions.h.
Definition at line 77 of file LangOptions.h.
|
strong |
Definition at line 158 of file LangOptions.h.
Enumerator | |
---|---|
DCC_None | |
DCC_CDecl | |
DCC_FastCall | |
DCC_StdCall | |
DCC_VectorCall | |
DCC_RegCall |
Definition at line 100 of file LangOptions.h.
Enumerator | |
---|---|
FEA_Off | |
FEA_On |
Definition at line 187 of file LangOptions.h.
Enumerator | |
---|---|
FPC_Off | |
FPC_On | |
FPC_Fast |
Definition at line 175 of file LangOptions.h.
Possible floating point exception behavior.
Definition at line 212 of file LangOptions.h.
Possible rounding modes.
Definition at line 198 of file LangOptions.h.
Enumerator | |
---|---|
NonGC | |
GCOnly | |
HybridGC |
Definition at line 57 of file LangOptions.h.
|
strong |
Definition at line 221 of file LangOptions.h.
Enumerator | |
---|---|
MSVC2010 | |
MSVC2012 | |
MSVC2013 | |
MSVC2015 | |
MSVC2017 | |
MSVC2017_5 | |
MSVC2017_7 |
Definition at line 112 of file LangOptions.h.
Enumerator | |
---|---|
PPTMK_BestCase | |
PPTMK_FullGeneralitySingleInheritance | |
PPTMK_FullGeneralityMultipleInheritance | |
PPTMK_FullGeneralityVirtualInheritance |
Definition at line 91 of file LangOptions.h.
Enumerator | |
---|---|
SOB_Undefined | |
SOB_Defined | |
SOB_Trapping |
Definition at line 65 of file LangOptions.h.
Enumerator | |
---|---|
SSPOff | |
SSPOn | |
SSPStrong | |
SSPReq |
Definition at line 58 of file LangOptions.h.
|
strong |
Enumerator | |
---|---|
Uninitialized | |
Zero | |
Pattern |
Definition at line 63 of file LangOptions.h.
LangOptions::LangOptions | ( | ) |
Definition at line 17 of file LangOptions.cpp.
|
inline |
True if any ObjC types may have non-trivial lifetime qualifiers.
Definition at line 344 of file LangOptions.h.
Referenced by DiagnoseBadFunctionCast(), DiagnoseReinterpretUpDownCast(), clang::Sema::PerformImplicitConversion(), and TryAddressSpaceCast().
|
inline |
Definition at line 348 of file LangOptions.h.
VersionTuple LangOptions::getOpenCLVersionTuple | ( | ) | const |
Return the OpenCL C or C++ version as a VersionTuple.
Definition at line 46 of file LangOptions.cpp.
|
inline |
Definition at line 331 of file LangOptions.h.
Referenced by AddKeyword(), clang::TextDiagnostic::emitDiagnosticLoc(), and NarrowingErrs().
|
inline |
Are we compiling a module interface (.cppm or module map)?
Definition at line 313 of file LangOptions.h.
References clang::CMK_None.
Referenced by clang::ModuleMap::addHeader(), clang::ModuleMap::diagnoseHeaderInclusion(), clang::PCHGenerator::HandleTranslationUnit(), clang::ASTUnit::isModuleFile(), and remapMacroPath().
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 39 of file LangOptions.cpp.
References NoBuiltinFuncs.
Referenced by clang::Builtin::Context::isBuiltinFunc().
|
inline |
Definition at line 322 of file LangOptions.h.
Referenced by DiagnoseBadShiftValues(), clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitOMPArraySectionExpr(), emitPointerArithmetic(), and tryEmitFMulAdd().
|
inline |
Definition at line 326 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 23 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 318 of file LangOptions.h.
Referenced by clang::Decl::hasLocalOwningModuleStorage().
CoreFoundationABI clang::LangOptions::CFRuntime = CoreFoundationABI::Unspecified |
Definition at line 259 of file LangOptions.h.
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString().
CommentOptions clang::LangOptions::CommentOpts |
Options for parsing comments.
Definition at line 286 of file LangOptions.h.
Referenced by clang::Sema::ActOnComment(), clang::ASTContext::addComment(), clang::ASTContext::cacheRawCommentForDecl(), checkLanguageOptions(), clang::CompilerInvocation::CreateFromArgs(), and clang::ASTContext::getRawCommentForDeclNoCacheImpl().
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. This starts as ModuleName in case -fmodule-name is provided and changes during compilation to reflect the current module.
Definition at line 277 of file LangOptions.h.
Referenced by clang::Preprocessor::checkModuleIsAvailable(), clang::GenerateModuleAction::CreateASTConsumer(), clang::FrontendAction::getCurrentModule(), clang::Preprocessor::getModuleForLocation(), clang::PCHGenerator::HandleTranslationUnit(), isInCurrentModule(), clang::CompilerInstance::loadModule(), prepareToBuildModule(), remapMacroPath(), and resetNonModularOptions().
Indicates whether the front-end is explicitly told that the input is a header file (i.e.
-x c-header).
Definition at line 301 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 283 of file LangOptions.h.
Referenced by checkLanguageOptions(), and hasFeature().
std::string clang::LangOptions::ModuleName |
The module currently being compiled as specified by -fmodule-name.
Definition at line 270 of file LangOptions.h.
Referenced by clang::Preprocessor::checkModuleIsAvailable(), and compileModuleImpl().
std::vector<std::string> clang::LangOptions::NoBuiltinFuncs |
A list of all -fno-builtin-* function names (e.g., memset).
Definition at line 289 of file LangOptions.h.
Referenced by isNoBuiltinFunc().
std::string clang::LangOptions::ObjCConstantStringClass |
Definition at line 261 of file LangOptions.h.
Referenced by GetConstantStringEntry().
clang::ObjCRuntime clang::LangOptions::ObjCRuntime |
Definition at line 257 of file LangOptions.h.
Referenced by clang::Decl::canBeWeakImported(), clang::Sema::CheckImplementationIvars(), checkLanguageOptions(), clang::RewriteObjCAction::CreateASTConsumer(), clang::CodeGen::CreateGNUObjCRuntime(), clang::CodeGen::CodeGenFunction::EmitARCReclaimReturnedObject(), FindIvarInterface(), clang::ASTNameGenerator::Implementation::getClassSymbolPrefix(), getObjCPersonality(), getObjCXXPersonality(), hasUnwindExceptions(), clang::Sema::MaybeBindToTemporary(), PersonalityHasOnlyCXXUses(), clang::CodeGen::CGDebugInfo::remapDIPath(), setARCRuntimeFunctionLinkage(), tryEmitSpecializedAllocInit(), tryGenerateSpecializedMessageSend(), 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 297 of file LangOptions.h.
Referenced by clang::CodeGen::loadOffloadInfoMetadata().
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 293 of file LangOptions.h.
Referenced by emitCommonOMPTargetDirective(), clang::CodeGen::emitDeclareTargetVarDefinition(), clang::CodeGen::emitRequiresDirectiveRegFun(), and clang::CodeGen::registerTargetGlobalVariable().
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 267 of file LangOptions.h.
SanitizerSet clang::LangOptions::Sanitize |
Set of enabled sanitizers.
Definition at line 234 of file LangOptions.h.
Referenced by addSanitizersAtO0(), checkLanguageOptions(), clang::CompilerInvocation::CreateFromArgs(), clang::CodeGen::CodeGenModule::CreateFunctionTypeMetadataForIcall(), clang::CodeGen::SanitizerMetadata::disableSanitizerForGlobal(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenModule::isInSanitizerBlacklist(), clang::CodeGen::CodeGenModule::Release(), 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 238 of file LangOptions.h.
Referenced by 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.
WARNING: This is a deprecated field and will go away in the future.
Definition at line 244 of file LangOptions.h.
Referenced by resetNonModularOptions().
std::vector<std::string> clang::LangOptions::XRayAttrListFiles |
Paths to the XRay attribute list files, specifying which objects (files, functions, variables) should be imbued with the appropriate XRay attribute(s).
Definition at line 255 of file LangOptions.h.
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.
WARNING: This is a deprecated field and will go away in the future.
Definition at line 250 of file LangOptions.h.
Referenced by resetNonModularOptions().