clang
9.0.0
|
Helper class for holding the data necessary to invoke the compiler. More...
#include "clang/Frontend/CompilerInvocation.h"
Utility Methods | |
std::string | getModuleHash () const |
Retrieve a module hash string that is suitable for uniquely identifying the conditions under which the module was built. More... | |
static bool | CreateFromArgs (CompilerInvocation &Res, const char *const *ArgBegin, const char *const *ArgEnd, DiagnosticsEngine &Diags) |
Create a compiler invocation from a list of input options. More... | |
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). More... | |
static void | setLangDefaults (LangOptions &Opts, InputKind IK, const llvm::Triple &T, PreprocessorOptions &PPOpts, LangStandard::Kind LangStd=LangStandard::lang_unspecified) |
Set language defaults for the given input language and language standard in the given LangOptions object. More... | |
Additional Inherited Members | |
![]() | |
std::shared_ptr< LangOptions > | LangOpts |
Options controlling the language variant. More... | |
std::shared_ptr< TargetOptions > | TargetOpts |
Options controlling the target. More... | |
IntrusiveRefCntPtr< DiagnosticOptions > | DiagnosticOpts |
Options controlling the diagnostic engine. More... | |
std::shared_ptr< HeaderSearchOptions > | HeaderSearchOpts |
Options controlling the #include directive. More... | |
std::shared_ptr< PreprocessorOptions > | PreprocessorOpts |
Options controlling the preprocessor (aside from #include handling). More... | |
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 120 of file CompilerInvocation.h.
|
inline |
Definition at line 142 of file CompilerInvocation.h.
|
static |
Create a compiler invocation from a list of input options.
[out] | Res | - The resulting invocation. |
ArgBegin | - The first element in the argument vector. | |
ArgEnd | - The last element in the argument vector. | |
Diags | - The diagnostic engine to use for errors. |
Definition at line 3317 of file CompilerInvocation.cpp.
References clang::FrontendOptions::AuxTriple, clang::driver::options::CC1Option, clang::LangOptions::CommentOpts, clang::driver::createDriverOptTable(), clang::SanitizerSet::empty(), getAnalyzerOpts(), getCodeGenOpts(), getDependencyOutputOpts(), clang::CompilerInvocationBase::getDiagnosticOpts(), getFileSystemOpts(), getFrontendOpts(), clang::CompilerInvocationBase::getHeaderSearchOpts(), clang::CompilerInvocationBase::getLangOpts(), clang::getLastArgIntValue(), getMigratorOpts(), clang::CompilerInvocationBase::getPreprocessorOpts(), getPreprocessorOutputOpts(), clang::CompilerInvocationBase::getTargetOpts(), clang::SanitizerSet::has(), clang::TargetOptions::HostTriple, clang::if(), clang::LangOptions::IsHeaderFile, clang::CompilerInvocationBase::LangOpts, clang::InputKind::LLVM_IR, ParseAnalyzerArgs(), ParseCodeGenArgs(), ParseCommentArgs(), ParseDependencyOutputArgs(), clang::ParseDiagnosticArgs(), ParseFileSystemArgs(), ParseFrontendArgs(), ParseHeaderSearchArgs(), ParseLangArgs(), ParseMigratorArgs(), ParsePreprocessorArgs(), ParsePreprocessorOutputArgs(), parseSanitizerKinds(), ParseTargetArgs(), clang::InputKind::Precompiled, clang::FrontendOptions::ProgramAction, clang::DiagnosticsEngine::Report(), clang::frontend::RewriteObjC, clang::LangOptions::Sanitize, clang::TargetOptions::Triple, clang::DiagnosticOptions::Warnings, and clang::FileSystemOptions::WorkingDir.
Referenced by clang::createInvocationFromCommandLine(), and clang::tooling::newInvocation().
|
inline |
Definition at line 189 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 194 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 195 of file CompilerInvocation.h.
|
inline |
Definition at line 197 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 201 of file CompilerInvocation.h.
|
inline |
Definition at line 205 of file CompilerInvocation.h.
Referenced by CreateFromArgs(), and createInvocationForMigration().
|
inline |
Definition at line 207 of file CompilerInvocation.h.
|
inline |
Definition at line 211 of file CompilerInvocation.h.
Referenced by applyTransforms(), CreateFromArgs(), makeStandaloneDiagnostic(), and clang::PrecompiledPreamble::OverridePreamble().
|
inline |
Definition at line 212 of file CompilerInvocation.h.
|
inline |
Definition at line 191 of file CompilerInvocation.h.
Referenced by applyTransforms(), clang::arcmt::checkForManualIssues(), and CreateFromArgs().
|
inline |
Definition at line 192 of file CompilerInvocation.h.
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 3437 of file CompilerInvocation.cpp.
References clang::SanitizerSet::clear(), clang::PreprocessorOptions::DetailedRecord, clang::SanitizerSet::empty(), clang::getClangFullRepositoryVersion(), clang::CompilerInvocationBase::getHeaderSearchOpts(), clang::getPPTransparentSanitizers(), clang::CompilerInvocationBase::getPreprocessorOpts(), clang::format::hash_combine(), clang::hash_value(), clang::CompilerInvocationBase::LangOpts, clang::SanitizerSet::Mask, clang::FrontendOptions::ModuleFileExtensions, clang::HeaderSearchOptions::ModuleFormat, clang::HeaderSearchOptions::ModulesIgnoreMacros, clang::HeaderSearchOptions::ModulesValidateDiagnosticOptions, clang::HeaderSearchOptions::ModuleUserBuildPath, clang::HeaderSearchOptions::ResourceDir, clang::HeaderSearchOptions::Sysroot, clang::CompilerInvocationBase::TargetOpts, clang::HeaderSearchOptions::UseBuiltinIncludes, clang::HeaderSearchOptions::UseDebugInfo, clang::HeaderSearchOptions::UseLibcxx, clang::PreprocessorOptions::UsePredefines, clang::HeaderSearchOptions::UseStandardCXXIncludes, and clang::HeaderSearchOptions::UseStandardSystemIncludes.
Referenced by compileModuleImpl(), and clang::CompilerInstance::getSpecificModuleCachePath().
|
inline |
Definition at line 214 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 218 of file CompilerInvocation.h.
References clang::createVFSFromCompilerInvocation().
|
static |
Get the directory where the compiler headers reside, relative to the compiler binary (found by the passed in arguments).
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 1960 of file CompilerInvocation.cpp.
Referenced by injectResourceDir().
|
static |
Set language defaults for the given input language and language standard in the given LangOptions object.
Opts | - The LangOptions object to set up. |
IK | - The input language. |
T | - The target triple. |
PPOpts | - The PreprocessorOptions affected. |
LangStd | - The input language standard. |
Definition at line 2106 of file CompilerInvocation.cpp.
References clang::InputKind::Asm, clang::InputKind::C, clang::InputKind::CUDA, clang::InputKind::CXX, clang::LangOptions::FPC_Fast, clang::LangOptions::FPC_On, clang::LangStandard::getLangStandardForKind(), clang::InputKind::getLanguage(), clang::LangStandard::hasDigraphs(), clang::LangStandard::hasHexFloats(), clang::LangStandard::hasImplicitInt(), clang::LangStandard::hasLineComments(), clang::InputKind::HIP, clang::PreprocessorOptions::Includes, clang::LangStandard::isC11(), clang::LangStandard::isC17(), clang::LangStandard::isC2x(), clang::LangStandard::isC99(), clang::LangStandard::isCPlusPlus(), clang::LangStandard::isCPlusPlus11(), clang::LangStandard::isCPlusPlus14(), clang::LangStandard::isCPlusPlus17(), clang::LangStandard::isCPlusPlus2a(), clang::LangStandard::isGNUMode(), clang::InputKind::isObjectiveC(), clang::LangStandard::isOpenCL(), clang::LangStandard::lang_unspecified, clang::InputKind::LLVM_IR, clang::InputKind::ObjC, clang::InputKind::ObjCXX, clang::InputKind::OpenCL, clang::InputKind::RenderScript, Std, and clang::InputKind::Unknown.