clang
3.9.0
|
Helper class for holding the data necessary to invoke the compiler. More...
#include <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... | |
IntrusiveRefCntPtr < HeaderSearchOptions > | HeaderSearchOpts |
Options controlling the #include directive. More... | |
IntrusiveRefCntPtr < 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 103 of file CompilerInvocation.h.
|
inline |
Definition at line 125 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 2310 of file CompilerInvocation.cpp.
References clang::FrontendOptions::AuxTriple, clang::driver::options::CC1Option, clang::LangOptions::CommentOpts, clang::driver::createDriverOptTable(), clang::CodeGenOptions::FPC_Fast, 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::IK_AST, clang::IK_LLVM_IR, ParseAnalyzerArgs(), ParseCodeGenArgs(), ParseCommentArgs(), ParseDependencyOutputArgs(), clang::ParseDiagnosticArgs(), ParseFileSystemArgs(), ParseFrontendArgs(), ParseHeaderSearchArgs(), ParseLangArgs(), ParseMigratorArgs(), ParsePreprocessorArgs(), ParsePreprocessorOutputArgs(), parseSanitizerKinds(), ParseTargetArgs(), clang::FrontendOptions::ProgramAction, clang::DiagnosticsEngine::Report(), clang::frontend::RewriteObjC, and clang::LangOptions::Sanitize.
Referenced by clang::createInvocationFromCommandLine(), and clang::tooling::newInvocation().
|
inline |
Definition at line 172 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 181 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 182 of file CompilerInvocation.h.
|
inline |
Definition at line 186 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 clang::ASTUnit::create(), CreateFromArgs(), and createInvocationForMigration().
|
inline |
Definition at line 194 of file CompilerInvocation.h.
|
inline |
Definition at line 198 of file CompilerInvocation.h.
Referenced by applyTransforms(), CreateFromArgs(), clang::ASTUnit::getMainFileName(), and clang::ASTUnit::LoadFromCompilerInvocationAction().
|
inline |
Definition at line 199 of file CompilerInvocation.h.
|
inline |
Definition at line 176 of file CompilerInvocation.h.
Referenced by applyTransforms(), clang::arcmt::checkForManualIssues(), and CreateFromArgs().
|
inline |
Definition at line 177 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 2400 of file CompilerInvocation.cpp.
References clang::PreprocessorOptions::DetailedRecord, clang::getClangFullRepositoryVersion(), I, clang::FrontendOptions::ModuleFileExtensions, clang::HeaderSearchOptions::ModuleFormat, clang::HeaderSearchOptions::ModulesIgnoreMacros, clang::HeaderSearchOptions::ModuleUserBuildPath, clang::HeaderSearchOptions::ResourceDir, clang::HeaderSearchOptions::Sysroot, 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 203 of file CompilerInvocation.h.
Referenced by CreateFromArgs().
|
inline |
Definition at line 206 of file CompilerInvocation.h.
|
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 1333 of file CompilerInvocation.cpp.
References CLANG_VERSION_STRING, and 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 1471 of file CompilerInvocation.cpp.
References clang::LangStandard::getLangStandardForKind(), clang::LangStandard::hasDigraphs(), clang::LangStandard::hasHexFloats(), clang::LangStandard::hasImplicitInt(), clang::LangStandard::hasLineComments(), clang::IK_Asm, clang::IK_AST, clang::IK_C, clang::IK_CUDA, clang::IK_CXX, clang::IK_LLVM_IR, clang::IK_None, clang::IK_ObjC, clang::IK_ObjCXX, clang::IK_OpenCL, clang::IK_PreprocessedC, clang::IK_PreprocessedCuda, clang::IK_PreprocessedCXX, clang::IK_PreprocessedObjC, clang::IK_PreprocessedObjCXX, clang::IK_RenderScript, clang::PreprocessorOptions::Includes, clang::LangStandard::isC11(), clang::LangStandard::isC89(), clang::LangStandard::isC99(), clang::LangStandard::isCPlusPlus(), clang::LangStandard::isCPlusPlus11(), clang::LangStandard::isCPlusPlus14(), clang::LangStandard::isCPlusPlus1z(), clang::LangStandard::isGNUMode(), isOpenCL(), and clang::LangStandard::lang_unspecified.
Referenced by ParseLangArgs().