clang API Documentation
#include <CompilerInvocation.h>


CompilerInvocation - 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 67 of file CompilerInvocation.h.
| clang::CompilerInvocation::CompilerInvocation | ( | ) | [inline] |
Definition at line 101 of file CompilerInvocation.h.
| bool CompilerInvocation::CreateFromArgs | ( | CompilerInvocation & | Res, |
| const char *const * | ArgBegin, | ||
| const char *const * | ArgEnd, | ||
| DiagnosticsEngine & | Diags | ||
| ) | [static] |
CreateFromArgs - Create a compiler invocation from a list of input options. Returns true on success.
| Res | [out] - 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 2144 of file CompilerInvocation.cpp.
References Args, clang::driver::createDriverOptTable(), getAnalyzerOpts(), getCodeGenOpts(), getDependencyOutputOpts(), getDiagnosticOpts(), getFileSystemOpts(), getFrontendOpts(), getHeaderSearchOpts(), clang::CompilerInvocationBase::getLangOpts(), getMigratorOpts(), getPreprocessorOpts(), getPreprocessorOutputOpts(), getTargetOpts(), clang::IK_AST, clang::IK_LLVM_IR, ParseAnalyzerArgs(), ParseCodeGenArgs(), ParseDependencyOutputArgs(), clang::ParseDiagnosticArgs(), ParseFileSystemArgs(), ParseFrontendArgs(), ParseHeaderSearchArgs(), ParseLangArgs(), ParseMigratorArgs(), ParsePreprocessorArgs(), ParsePreprocessorOutputArgs(), ParseTargetArgs(), clang::FrontendOptions::ProgramAction, clang::DiagnosticsEngine::Report(), and clang::frontend::RewriteObjC.
Referenced by clang::createInvocationFromCommandLine(), and clang::tooling::newInvocation().
| AnalyzerOptions& clang::CompilerInvocation::getAnalyzerOpts | ( | ) | [inline] |
Definition at line 159 of file CompilerInvocation.h.
Referenced by CreateFromArgs(), and toArgs().
| const AnalyzerOptions& clang::CompilerInvocation::getAnalyzerOpts | ( | ) | const [inline] |
Definition at line 160 of file CompilerInvocation.h.
| CodeGenOptions& clang::CompilerInvocation::getCodeGenOpts | ( | ) | [inline] |
Definition at line 169 of file CompilerInvocation.h.
Referenced by CreateFromArgs(), and toArgs().
| const CodeGenOptions& clang::CompilerInvocation::getCodeGenOpts | ( | ) | const [inline] |
Definition at line 170 of file CompilerInvocation.h.
| DependencyOutputOptions& clang::CompilerInvocation::getDependencyOutputOpts | ( | ) | [inline] |
Definition at line 174 of file CompilerInvocation.h.
Referenced by CreateFromArgs(), and toArgs().
| const DependencyOutputOptions& clang::CompilerInvocation::getDependencyOutputOpts | ( | ) | const [inline] |
Definition at line 177 of file CompilerInvocation.h.
| DiagnosticOptions& clang::CompilerInvocation::getDiagnosticOpts | ( | ) | [inline] |
Definition at line 181 of file CompilerInvocation.h.
Referenced by clang::arcmt::checkForManualIssues(), CreateFromArgs(), clang::ASTUnit::LoadFromCompilerInvocationAction(), clang::ASTUnit::Reparse(), and toArgs().
| const DiagnosticOptions& clang::CompilerInvocation::getDiagnosticOpts | ( | ) | const [inline] |
Definition at line 182 of file CompilerInvocation.h.
| FileSystemOptions& clang::CompilerInvocation::getFileSystemOpts | ( | ) | [inline] |
Definition at line 184 of file CompilerInvocation.h.
Referenced by clang::ASTUnit::create(), CreateFromArgs(), and toArgs().
| const FileSystemOptions& clang::CompilerInvocation::getFileSystemOpts | ( | ) | const [inline] |
Definition at line 185 of file CompilerInvocation.h.
| FrontendOptions& clang::CompilerInvocation::getFrontendOpts | ( | ) | [inline] |
Definition at line 194 of file CompilerInvocation.h.
Referenced by applyTransforms(), CreateFromArgs(), clang::ASTUnit::getMainFileName(), clang::ASTUnit::LoadFromCompilerInvocationAction(), and toArgs().
| const FrontendOptions& clang::CompilerInvocation::getFrontendOpts | ( | ) | const [inline] |
Definition at line 195 of file CompilerInvocation.h.
| HeaderSearchOptions& clang::CompilerInvocation::getHeaderSearchOpts | ( | ) | [inline] |
Definition at line 189 of file CompilerInvocation.h.
Referenced by CreateFromArgs(), clang::ASTUnit::LoadFromCompilerInvocationAction(), and toArgs().
| const HeaderSearchOptions& clang::CompilerInvocation::getHeaderSearchOpts | ( | ) | const [inline] |
Definition at line 190 of file CompilerInvocation.h.
| MigratorOptions& clang::CompilerInvocation::getMigratorOpts | ( | ) | [inline] |
Definition at line 164 of file CompilerInvocation.h.
Referenced by applyTransforms(), clang::arcmt::checkForManualIssues(), and CreateFromArgs().
| const MigratorOptions& clang::CompilerInvocation::getMigratorOpts | ( | ) | const [inline] |
Definition at line 165 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 2260 of file CompilerInvocation.cpp.
Referenced by compileModule().
| PreprocessorOptions& clang::CompilerInvocation::getPreprocessorOpts | ( | ) | [inline] |
Definition at line 199 of file CompilerInvocation.h.
Referenced by CreateFromArgs(), createInvocationForMigration(), HasARCRuntime(), clang::ASTUnit::LoadFromCompilerInvocationAction(), clang::ASTUnit::Reparse(), and toArgs().
| const PreprocessorOptions& clang::CompilerInvocation::getPreprocessorOpts | ( | ) | const [inline] |
Definition at line 200 of file CompilerInvocation.h.
| PreprocessorOutputOptions& clang::CompilerInvocation::getPreprocessorOutputOpts | ( | ) | [inline] |
Definition at line 204 of file CompilerInvocation.h.
Referenced by CreateFromArgs(), and toArgs().
| const PreprocessorOutputOptions& clang::CompilerInvocation::getPreprocessorOutputOpts | ( | ) | const [inline] |
Definition at line 207 of file CompilerInvocation.h.
| std::string CompilerInvocation::GetResourcesPath | ( | const char * | Argv0, |
| void * | MainAddr | ||
| ) | [static] |
GetBuiltinIncludePath - 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 1585 of file CompilerInvocation.cpp.
References CLANG_VERSION_STRING, and P.
| TargetOptions& clang::CompilerInvocation::getTargetOpts | ( | ) | [inline] |
Definition at line 211 of file CompilerInvocation.h.
Referenced by CreateFromArgs(), HasARCRuntime(), clang::ASTUnit::LoadFromCompilerInvocationAction(), and toArgs().
| const TargetOptions& clang::CompilerInvocation::getTargetOpts | ( | ) | const [inline] |
Definition at line 212 of file CompilerInvocation.h.
| void clang::CompilerInvocation::setLangDefaults | ( | InputKind | IK, |
| LangStandard::Kind | LangStd = LangStandard::lang_unspecified |
||
| ) | [inline] |
setLangDefaults - Set language defaults for the given input language and language standard in this CompilerInvocation.
Definition at line 137 of file CompilerInvocation.h.
References clang::CompilerInvocationBase::getLangOpts().
Referenced by ParseLangArgs().
| void CompilerInvocation::setLangDefaults | ( | LangOptions & | Opts, |
| InputKind | IK, | ||
| LangStandard::Kind | LangStd = LangStandard::lang_unspecified |
||
| ) | [static] |
setLangDefaults - Set language defaults for the given input language and language standard in the given LangOptions object.
| LangOpts | - The LangOptions object to set up. |
| IK | - The input language. |
| LangStd | - The input language standard. |
Definition at line 1690 of file CompilerInvocation.cpp.
References clang::LangStandard::getLangStandardForKind(), clang::LangStandard::hasBCPLComments(), clang::LangStandard::hasDigraphs(), clang::LangStandard::hasHexFloats(), clang::LangStandard::hasImplicitInt(), 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_PreprocessedCXX, clang::IK_PreprocessedObjC, clang::IK_PreprocessedObjCXX, clang::LangStandard::isC11(), clang::LangStandard::isC99(), clang::LangStandard::isCPlusPlus(), clang::LangStandard::isCPlusPlus0x(), and clang::LangStandard::isGNUMode().
| void CompilerInvocation::toArgs | ( | std::vector< std::string > & | Res | ) |
toArgs - Convert the CompilerInvocation to a list of strings suitable for passing to CreateFromArgs.
Definition at line 898 of file CompilerInvocation.cpp.
References AnalyzerOptsToArgs(), CodeGenOptsToArgs(), DependencyOutputOptsToArgs(), DiagnosticOptsToArgs(), FileSystemOptsToArgs(), FrontendOptsToArgs(), getAnalyzerOpts(), getCodeGenOpts(), getDependencyOutputOpts(), getDiagnosticOpts(), getFileSystemOpts(), getFrontendOpts(), getHeaderSearchOpts(), clang::CompilerInvocationBase::getLangOpts(), getPreprocessorOpts(), getPreprocessorOutputOpts(), getTargetOpts(), HeaderSearchOptsToArgs(), LangOptsToArgs(), PreprocessorOptsToArgs(), PreprocessorOutputOptsToArgs(), and TargetOptsToArgs().