clang API Documentation

Public Member Functions
clang::CompilerInvocation Class Reference

#include <CompilerInvocation.h>

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

List of all members.

Public Member Functions

 CompilerInvocation ()
Option Subgroups
AnalyzerOptionsgetAnalyzerOpts ()
const AnalyzerOptionsgetAnalyzerOpts () const
MigratorOptionsgetMigratorOpts ()
const MigratorOptionsgetMigratorOpts () const
CodeGenOptionsgetCodeGenOpts ()
const CodeGenOptionsgetCodeGenOpts () const
DependencyOutputOptionsgetDependencyOutputOpts ()
const DependencyOutputOptionsgetDependencyOutputOpts () const
DiagnosticOptionsgetDiagnosticOpts ()
const DiagnosticOptionsgetDiagnosticOpts () const
FileSystemOptionsgetFileSystemOpts ()
const FileSystemOptionsgetFileSystemOpts () const
HeaderSearchOptionsgetHeaderSearchOpts ()
const HeaderSearchOptionsgetHeaderSearchOpts () const
FrontendOptionsgetFrontendOpts ()
const FrontendOptionsgetFrontendOpts () const
PreprocessorOptionsgetPreprocessorOpts ()
const PreprocessorOptionsgetPreprocessorOpts () const
PreprocessorOutputOptionsgetPreprocessorOutputOpts ()
const PreprocessorOutputOptionsgetPreprocessorOutputOpts () const
TargetOptionsgetTargetOpts ()
const TargetOptionsgetTargetOpts () const

Utility Methods

void toArgs (std::vector< std::string > &Res)
void setLangDefaults (InputKind IK, LangStandard::Kind LangStd=LangStandard::lang_unspecified)
std::string getModuleHash () const
 Retrieve a module hash string that is suitable for uniquely identifying the conditions under which the module was built.
static bool CreateFromArgs (CompilerInvocation &Res, const char *const *ArgBegin, const char *const *ArgEnd, DiagnosticsEngine &Diags)
static std::string GetResourcesPath (const char *Argv0, void *MainAddr)
static void setLangDefaults (LangOptions &Opts, InputKind IK, LangStandard::Kind LangStd=LangStandard::lang_unspecified)

Detailed Description

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.


Constructor & Destructor Documentation

clang::CompilerInvocation::CompilerInvocation ( ) [inline]

Definition at line 101 of file CompilerInvocation.h.


Member Function Documentation

bool CompilerInvocation::CreateFromArgs ( CompilerInvocation Res,
const char *const *  ArgBegin,
const char *const *  ArgEnd,
DiagnosticsEngine Diags 
) [static]
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]
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]
const FrontendOptions& clang::CompilerInvocation::getFrontendOpts ( ) const [inline]

Definition at line 195 of file CompilerInvocation.h.

HeaderSearchOptions& clang::CompilerInvocation::getHeaderSearchOpts ( ) [inline]
const HeaderSearchOptions& clang::CompilerInvocation::getHeaderSearchOpts ( ) const [inline]

Definition at line 190 of file CompilerInvocation.h.

MigratorOptions& clang::CompilerInvocation::getMigratorOpts ( ) [inline]
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]
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).

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

References CLANG_VERSION_STRING, and P.

TargetOptions& clang::CompilerInvocation::getTargetOpts ( ) [inline]
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.

Parameters:
IK- The input language.
LangStd- The input language standard.

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]
void CompilerInvocation::toArgs ( std::vector< std::string > &  Res)

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