clang API Documentation

Public Member Functions
clang::CompilerInvocation Class Reference

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

#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 ()
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

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.
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.
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).
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.

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

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]

Definition at line 166 of file CompilerInvocation.h.

Referenced by CreateFromArgs().

Definition at line 175 of file CompilerInvocation.h.

Referenced by CreateFromArgs().

Definition at line 176 of file CompilerInvocation.h.

Definition at line 180 of file CompilerInvocation.h.

Referenced by CreateFromArgs().

Definition at line 183 of file CompilerInvocation.h.

Definition at line 188 of file CompilerInvocation.h.

Definition at line 193 of file CompilerInvocation.h.

Definition at line 171 of file CompilerInvocation.h.

std::string CompilerInvocation::getModuleHash ( ) const

Definition at line 197 of file CompilerInvocation.h.

Referenced by CreateFromArgs().

Definition at line 200 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 975 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: