clang
10.0.0git
|
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, ArrayRef< const char *> CommandLineArgs, 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 121 of file CompilerInvocation.h.
|
inline |
Definition at line 143 of file CompilerInvocation.h.
|
static |
Create a compiler invocation from a list of input options.
Res
will end up in one of the vaild-to-access (albeit arbitrary) states.[out] | Res | - The resulting invocation. |
Definition at line 3505 of file CompilerInvocation.cpp.
References clang::FrontendOptions::AuxTriple, clang::driver::options::CC1Option, clang::LangOptions::CommentOpts, clang::SanitizerSet::empty(), getAnalyzerOpts(), getCodeGenOpts(), getDependencyOutputOpts(), clang::CompilerInvocationBase::getDiagnosticOpts(), clang::driver::getDriverOptTable(), 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::LLVM_IR, clang::FrontendOptions::LLVMArgs, clang::DependencyOutputOptions::OutputFile, 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::DependencyOutputOptions::Targets, clang::TargetOptions::Triple, clang::DiagnosticOptions::Warnings, and clang::FileSystemOptions::WorkingDir.
Referenced by clang::createInvocationFromCommandLine(), and clang::tooling::newInvocation().
|
inline |
Definition at line 191 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 196 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 197 of file CompilerInvocation.h.
|
inline |
Definition at line 199 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 203 of file CompilerInvocation.h.
|
inline |
Definition at line 207 of file CompilerInvocation.h.
Referenced by CreateFromArgs(), and createInvocationForMigration().
|
inline |
Definition at line 209 of file CompilerInvocation.h.
|
inline |
Definition at line 213 of file CompilerInvocation.h.
Referenced by applyTransforms(), CreateFromArgs(), makeStandaloneDiagnostic(), and clang::PrecompiledPreamble::OverridePreamble().
|
inline |
Definition at line 214 of file CompilerInvocation.h.
|
inline |
Definition at line 193 of file CompilerInvocation.h.
Referenced by applyTransforms(), clang::arcmt::checkForManualIssues(), and CreateFromArgs().
|
inline |
Definition at line 194 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 3631 of file CompilerInvocation.cpp.
References clang::SanitizerSet::clear(), clang::PreprocessorOptions::DetailedRecord, clang::SanitizerSet::empty(), clang::getClangFullRepositoryVersion(), clang::CompilerInvocationBase::getDiagnosticOpts(), 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::ModulesStrictContextHash, clang::HeaderSearchOptions::ModulesValidateDiagnosticOptions, clang::HeaderSearchOptions::ModuleUserBuildPath, clang::HeaderSearchOptions::ResourceDir, clang::HeaderSearchOptions::Sysroot, clang::HeaderSearchOptions::SystemHeaderPrefixes, clang::CompilerInvocationBase::TargetOpts, clang::HeaderSearchOptions::UseBuiltinIncludes, clang::HeaderSearchOptions::UseDebugInfo, clang::HeaderSearchOptions::UseLibcxx, clang::PreprocessorOptions::UsePredefines, clang::HeaderSearchOptions::UserEntries, clang::HeaderSearchOptions::UseStandardCXXIncludes, and clang::HeaderSearchOptions::UseStandardSystemIncludes.
Referenced by compileModuleImpl(), and clang::CompilerInstance::getSpecificModuleCachePath().
|
inline |
Definition at line 216 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 220 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 2059 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 2208 of file CompilerInvocation.cpp.
References clang::Asm, clang::C, clang::CUDA, clang::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::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::LLVM_IR, clang::LangOptions::None, clang::ObjC, clang::ObjCXX, clang::OpenCL, clang::RenderScript, Std, and clang::Unknown.