clang
6.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 110 of file CompilerInvocation.h.
|
inline |
Definition at line 132 of file CompilerInvocation.h.
References clang::T.
|
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 2736 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::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::T, clang::TargetOptions::Triple, clang::DiagnosticOptions::Warnings, and clang::FileSystemOptions::WorkingDir.
Referenced by clang::createInvocationFromCommandLine(), and clang::tooling::newInvocation().
|
inline |
Definition at line 179 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 188 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 189 of file CompilerInvocation.h.
|
inline |
Definition at line 193 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 196 of file CompilerInvocation.h.
|
inline |
Definition at line 200 of file CompilerInvocation.h.
Referenced by CreateFromArgs(), and createInvocationForMigration().
|
inline |
Definition at line 201 of file CompilerInvocation.h.
|
inline |
Definition at line 205 of file CompilerInvocation.h.
Referenced by clang::PrecompiledPreamble::AddImplicitPreamble(), CreateFromArgs(), clang::ASTUnit::getMainFileName(), and makeStandaloneDiagnostic().
|
inline |
Definition at line 206 of file CompilerInvocation.h.
|
inline |
Definition at line 183 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 184 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 2846 of file CompilerInvocation.cpp.
References clang::PreprocessorOptions::DetailedRecord, clang::getClangFullRepositoryVersion(), clang::CompilerInvocationBase::getHeaderSearchOpts(), clang::CompilerInvocationBase::getPreprocessorOpts(), clang::format::hash_combine(), clang::CompilerInvocationBase::LangOpts, clang::CompilerInvocationBase::TargetOpts, and clang::PreprocessorOptions::UsePredefines.
Referenced by clang::CompilerInstance::getSpecificModuleCachePath().
|
inline |
Definition at line 210 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 213 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 1568 of file CompilerInvocation.cpp.
References P.
Referenced by clang::tooling::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 1726 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::PreprocessorOptions::Includes, clang::LangStandard::isC11(), clang::LangStandard::isC17(), 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, and clang::InputKind::Unknown.
Referenced by ParseLangArgs().