clang  3.7.0
Public Member Functions | List of all members
clang::CompilerInvocation Class Reference

Helper class for holding the data necessary to invoke the compiler. More...

#include <CompilerInvocation.h>

Inheritance diagram for clang::CompilerInvocation:
[legend]
Collaboration diagram for clang::CompilerInvocation:
[legend]

Public Member Functions

 CompilerInvocation ()
 
Option Subgroups
AnalyzerOptionsRef getAnalyzerOpts () const
 
MigratorOptionsgetMigratorOpts ()
 
const MigratorOptionsgetMigratorOpts () const
 
CodeGenOptionsgetCodeGenOpts ()
 
const CodeGenOptionsgetCodeGenOpts () const
 
DependencyOutputOptionsgetDependencyOutputOpts ()
 
const DependencyOutputOptionsgetDependencyOutputOpts () const
 
FileSystemOptionsgetFileSystemOpts ()
 
const FileSystemOptionsgetFileSystemOpts () const
 
FrontendOptionsgetFrontendOpts ()
 
const FrontendOptionsgetFrontendOpts () const
 
PreprocessorOutputOptionsgetPreprocessorOutputOpts ()
 
const PreprocessorOutputOptionsgetPreprocessorOutputOpts () const
 
- Public Member Functions inherited from clang::CompilerInvocationBase
 CompilerInvocationBase ()
 
 ~CompilerInvocationBase ()
 
 CompilerInvocationBase (const CompilerInvocationBase &X)
 
LangOptionsgetLangOpts ()
 
const LangOptionsgetLangOpts () const
 
TargetOptionsgetTargetOpts ()
 
const TargetOptionsgetTargetOpts () const
 
DiagnosticOptionsgetDiagnosticOpts () const
 
HeaderSearchOptionsgetHeaderSearchOpts ()
 
const HeaderSearchOptionsgetHeaderSearchOpts () const
 
PreprocessorOptionsgetPreprocessorOpts ()
 
const PreprocessorOptionsgetPreprocessorOpts () const
 

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, 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

- Public Attributes inherited from clang::CompilerInvocationBase
std::shared_ptr< LangOptionsLangOpts
 Options controlling the language variant. More...
 
std::shared_ptr< TargetOptionsTargetOpts
 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...
 

Detailed Description

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 102 of file CompilerInvocation.h.

Constructor & Destructor Documentation

clang::CompilerInvocation::CompilerInvocation ( )
inline

Definition at line 124 of file CompilerInvocation.h.

Member Function Documentation

bool CompilerInvocation::CreateFromArgs ( CompilerInvocation Res,
const char *const *  ArgBegin,
const char *const *  ArgEnd,
DiagnosticsEngine Diags 
)
static
AnalyzerOptionsRef clang::CompilerInvocation::getAnalyzerOpts ( ) const
inline

Definition at line 168 of file CompilerInvocation.h.

Referenced by CreateFromArgs().

CodeGenOptions& clang::CompilerInvocation::getCodeGenOpts ( )
inline

Definition at line 177 of file CompilerInvocation.h.

Referenced by CreateFromArgs().

const CodeGenOptions& clang::CompilerInvocation::getCodeGenOpts ( ) const
inline

Definition at line 178 of file CompilerInvocation.h.

DependencyOutputOptions& clang::CompilerInvocation::getDependencyOutputOpts ( )
inline

Definition at line 182 of file CompilerInvocation.h.

Referenced by CreateFromArgs().

const DependencyOutputOptions& clang::CompilerInvocation::getDependencyOutputOpts ( ) const
inline

Definition at line 185 of file CompilerInvocation.h.

FileSystemOptions& clang::CompilerInvocation::getFileSystemOpts ( )
inline
const FileSystemOptions& clang::CompilerInvocation::getFileSystemOpts ( ) const
inline

Definition at line 190 of file CompilerInvocation.h.

FrontendOptions& clang::CompilerInvocation::getFrontendOpts ( )
inline
const FrontendOptions& clang::CompilerInvocation::getFrontendOpts ( ) const
inline

Definition at line 195 of file CompilerInvocation.h.

MigratorOptions& clang::CompilerInvocation::getMigratorOpts ( )
inline
const MigratorOptions& clang::CompilerInvocation::getMigratorOpts ( ) const
inline

Definition at line 173 of file CompilerInvocation.h.

std::string CompilerInvocation::getModuleHash ( ) const
PreprocessorOutputOptions& clang::CompilerInvocation::getPreprocessorOutputOpts ( )
inline

Definition at line 199 of file CompilerInvocation.h.

Referenced by CreateFromArgs().

const PreprocessorOutputOptions& clang::CompilerInvocation::getPreprocessorOutputOpts ( ) const
inline

Definition at line 202 of file CompilerInvocation.h.

std::string CompilerInvocation::GetResourcesPath ( const char *  Argv0,
void *  MainAddr 
)
static

Get the directory where the compiler headers reside, relative to the compiler binary (found by the passed in arguments).

Parameters
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 1070 of file CompilerInvocation.cpp.

References CLANG_VERSION_STRING, and P.

void CompilerInvocation::setLangDefaults ( LangOptions Opts,
InputKind  IK,
LangStandard::Kind  LangStd = LangStandard::lang_unspecified 
)
static

The documentation for this class was generated from the following files: