clang: clang::CompilerInvocation Class Reference (original ) (raw )Helper class for holding the data necessary to invoke the compiler. More...
#include "[clang/Frontend/CompilerInvocation.h](CompilerInvocation%5F8h%5Fsource.html)"
Static Public Member Functions
static bool
CreateFromArgs (CompilerInvocation &Res, ArrayRef < const char * > CommandLineArgs, DiagnosticsEngine &Diags, const char *Argv0=nullptr)
Create a compiler invocation from a list of input options.
static std::string
GetResourcesPath (const char *Argv0, void *MainAddr)
Get the directory where the compiler headers reside, relative to the compiler binary (found by the passed in arguments).
static void
setDefaultPointerAuthOptions (PointerAuthOptions &Opts, const LangOptions &LangOpts , const llvm::Triple &Triple)
Populate Opts with the default set of pointer authentication-related options given LangOpts and Triple.
static bool
checkCC1RoundTrip (ArrayRef < const char * > Args, DiagnosticsEngine &Diags, const char *Argv0=nullptr)
Check that Args can be parsed and re-serialized without change, emiting diagnostics for any differences.
std::shared_ptr< HeaderSearchOptions >
getHeaderSearchOptsPtr ()
std::shared_ptr< PreprocessorOptions >
getPreprocessorOptsPtr ()
std::shared_ptr< LangOptions >
getLangOptsPtr ()
std::shared_ptr< LangOptions >
LangOpts
Base class internals.
std::shared_ptr< TargetOptions >
TargetOpts
Options controlling the target.
IntrusiveRefCntPtr < DiagnosticOptions >
DiagnosticOpts
Options controlling the diagnostic engine.
Helper class for holding the data necessary to invoke the compiler.
This class is designed to represent an abstract "invocation" of the compiler, including data such as the include paths, the code generation options, the warning flags, and so on.
Definition at line 211 of file CompilerInvocation.h .
clang::CompilerInvocation::CompilerInvocation ( )
default
◆ CompilerInvocation() [2/4]◆ CompilerInvocation() [3/4]◆ ~CompilerInvocation()
clang::CompilerInvocation::~CompilerInvocation ( )
default
◆ CompilerInvocation() [4/4]◆ checkCC1RoundTrip()◆ clearImplicitModuleBuildOptions()
void CompilerInvocation::clearImplicitModuleBuildOptions
(
)
◆ CreateFromArgs()◆ getAnalyzerOpts() [1/2]◆ getAnalyzerOpts() [2/2]
const AnalyzerOptions & clang::CompilerInvocationBase::getAnalyzerOpts ( ) const
inline
◆ getAPINotesOpts() [1/2]◆ getAPINotesOpts() [2/2]
const APINotesOptions & clang::CompilerInvocationBase::getAPINotesOpts ( ) const
inline
◆ getCodeGenOpts() [1/2]◆ getCodeGenOpts() [2/2]
const CodeGenOptions & clang::CompilerInvocationBase::getCodeGenOpts ( ) const
inline
◆ getDependencyOutputOpts() [1/2]◆ getDependencyOutputOpts() [2/2]◆ getDiagnosticOpts() [1/2]◆ getDiagnosticOpts() [2/2]
const DiagnosticOptions & clang::CompilerInvocationBase::getDiagnosticOpts ( ) const
inline
◆ getFileSystemOpts() [1/2]◆ getFileSystemOpts() [2/2]
const FileSystemOptions & clang::CompilerInvocationBase::getFileSystemOpts ( ) const
inline
◆ getFrontendOpts() [1/2]◆ getFrontendOpts() [2/2]
const FrontendOptions & clang::CompilerInvocationBase::getFrontendOpts ( ) const
inline
const HeaderSearchOptions & clang::CompilerInvocationBase::getHeaderSearchOpts ( ) const
inline
std::shared_ptr< HeaderSearchOptions > clang::CompilerInvocation::getHeaderSearchOptsPtr ( )
inline
◆ getLangOpts() [1/2]
LangOptions & clang::CompilerInvocation::getLangOpts ( )
inline
◆ getLangOpts() [2/2]
const LangOptions & clang::CompilerInvocationBase::getLangOpts ( ) const
inline
◆ getLangOptsPtr()
std::shared_ptr< LangOptions > clang::CompilerInvocation::getLangOptsPtr ( )
inline
◆ getMigratorOpts() [1/2]◆ getMigratorOpts() [2/2]
const MigratorOptions & clang::CompilerInvocationBase::getMigratorOpts ( ) const
inline
◆ getModuleHash()
std::string CompilerInvocation::getModuleHash
(
)
const
Retrieve a module hash string that is suitable for uniquely identifying the conditions under which the module was built.
Definition at line 5062 of file CompilerInvocation.cpp .
References clang::CompilerInvocationBase::APINotesOpts , clang::SanitizerSet::clear() , clang::PreprocessorOptions::DetailedRecord , clang::SanitizerSet::empty() , getAPINotesOpts() , clang::getClangFullRepositoryVersion() , getCodeGenOpts() , getDiagnosticOpts() , getFrontendOpts() , getHeaderSearchOpts() , getLangOpts() , clang::getPPTransparentSanitizers() , getPreprocessorOpts() , getTargetOpts() , clang::SanitizerSet::Mask , clang::HeaderSearchOptions::ModuleFormat , clang::HeaderSearchOptions::ModulesIgnoreMacros , clang::HeaderSearchOptions::ModulesStrictContextHash , clang::HeaderSearchOptions::ModulesValidateDiagnosticOptions , clang::HeaderSearchOptions::ModuleUserBuildPath , clang::HeaderSearchOptions::ResourceDir , clang::Result , clang::LangOptions::Sanitize , clang::HeaderSearchOptions::Sysroot , clang::HeaderSearchOptions::SystemHeaderPrefixes , toString() , clang::HeaderSearchOptions::UseBuiltinIncludes , clang::HeaderSearchOptions::UseDebugInfo , clang::HeaderSearchOptions::UseLibcxx , clang::PreprocessorOptions::UsePredefines , clang::HeaderSearchOptions::UserEntries , clang::HeaderSearchOptions::UseStandardCXXIncludes , clang::HeaderSearchOptions::UseStandardSystemIncludes , clang::serialization::VERSION_MAJOR , clang::serialization::VERSION_MINOR , and clang::HeaderSearchOptions::VFSOverlayFiles .
Referenced by clang::CompilerInstance::createPreprocessor() , and clang::tooling::dependencies::ModuleDepCollectorPP::LexedFileChanged() .
◆ getPreprocessorOpts() [1/2]◆ getPreprocessorOpts() [2/2]
const PreprocessorOptions & clang::CompilerInvocationBase::getPreprocessorOpts ( ) const
inline
◆ getPreprocessorOptsPtr()
std::shared_ptr< PreprocessorOptions > clang::CompilerInvocation::getPreprocessorOptsPtr ( )
inline
◆ getPreprocessorOutputOpts() [1/2]◆ getPreprocessorOutputOpts() [2/2]◆ GetResourcesPath()
std::string CompilerInvocation::GetResourcesPath ( const char * Argv0 , void * MainAddr )
static
Get the directory where the compiler headers reside, relative to the compiler binary (found by the passed in arguments).
Parameters
Argv0
- The program path (from argv[0]), for finding the builtin compiler path.
MainAddr
- The address of main (or some other function in the main executable), for finding the builtin compiler path.
Definition at line 3229 of file CompilerInvocation.cpp .
References clang::driver::Driver::GetResourcesPath() .
Referenced by injectResourceDir() .
◆ getTargetOpts() [1/2]
TargetOptions & clang::CompilerInvocation::getTargetOpts ( )
inline
◆ getTargetOpts() [2/2]
const TargetOptions & clang::CompilerInvocationBase::getTargetOpts ( ) const
inline
◆ operator=() [1/2]◆ operator=() [2/2]◆ resetNonModularOptions()
void CompilerInvocation::resetNonModularOptions
(
)
◆ setDefaultPointerAuthOptions()
void CompilerInvocation::setDefaultPointerAuthOptions ( PointerAuthOptions & Opts , const LangOptions & LangOpts , const llvm::Triple & Triple )
static
Populate Opts
with the default set of pointer authentication-related options given LangOpts
and Triple
.
Note: This is intended to be used by tools which must be aware of pointer authentication-related code generation, e.g. lldb.
Definition at line 1524 of file CompilerInvocation.cpp .
References clang::PointerAuthOptions::AArch64JumpTableHardening , clang::PointerAuthOptions::AuthTraps , clang::PointerAuthOptions::CXXMemberFunctionPointers , clang::PointerAuthOptions::CXXTypeInfoVTablePointer , clang::PointerAuthOptions::CXXVirtualFunctionPointers , clang::PointerAuthOptions::CXXVirtualVariadicFunctionPointers , clang::PointerAuthOptions::CXXVTablePointers , clang::PointerAuthOptions::CXXVTTVTablePointers , clang::PointerAuthOptions::FunctionPointers , clang::PointerAuthOptions::IndirectGotos , clang::InitFiniPointerConstantDiscriminator , clang::PointerAuthOptions::InitFiniPointers , LangOpts , clang::PointerAuthOptions::ReturnAddresses , and clang::StdTypeInfoVTablePointerConstantDiscrimination .
Referenced by parsePointerAuthOptions() .
◆ DiagnosticOpts◆ LangOptsstd::shared_ptr<LangOptions > clang::CompilerInvocationBase::LangOpts
◆ TargetOptsstd::shared_ptr<TargetOptions > clang::CompilerInvocationBase::TargetOpts
The documentation for this class was generated from the following files: