clang API Documentation

Classes | Public Member Functions
clang::CompilerInstance Class Reference

#include <CompilerInstance.h>

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

List of all members.

Classes

struct  OutputFile
 Holds information about the output file.

Public Member Functions

 CompilerInstance ()
 ~CompilerInstance ()
High-Level Operations

{

bool ExecuteAction (FrontendAction &Act)
Compiler Invocation and Options

}

{

bool hasInvocation () const
CompilerInvocationgetInvocation ()
void setInvocation (CompilerInvocation *Value)
 setInvocation - Replace the current invocation.
Forwarding Methods

}

{

AnalyzerOptionsgetAnalyzerOpts ()
const AnalyzerOptionsgetAnalyzerOpts () const
CodeGenOptionsgetCodeGenOpts ()
const CodeGenOptionsgetCodeGenOpts () const
DependencyOutputOptionsgetDependencyOutputOpts ()
const DependencyOutputOptionsgetDependencyOutputOpts () const
DiagnosticOptionsgetDiagnosticOpts ()
const DiagnosticOptionsgetDiagnosticOpts () const
const FileSystemOptionsgetFileSystemOpts () const
FrontendOptionsgetFrontendOpts ()
const FrontendOptionsgetFrontendOpts () const
HeaderSearchOptionsgetHeaderSearchOpts ()
const HeaderSearchOptionsgetHeaderSearchOpts () const
LangOptionsgetLangOpts ()
const LangOptionsgetLangOpts () const
PreprocessorOptionsgetPreprocessorOpts ()
const PreprocessorOptionsgetPreprocessorOpts () const
PreprocessorOutputOptionsgetPreprocessorOutputOpts ()
const PreprocessorOutputOptionsgetPreprocessorOutputOpts () const
TargetOptionsgetTargetOpts ()
const TargetOptionsgetTargetOpts () const
Diagnostics Engine

}

{

bool hasDiagnostics () const
DiagnosticsEnginegetDiagnostics () const
 Get the current diagnostics engine.
void setDiagnostics (DiagnosticsEngine *Value)
 setDiagnostics - Replace the current diagnostics engine.
DiagnosticConsumergetDiagnosticClient () const
Target Info

}

{

bool hasTarget () const
TargetInfogetTarget () const
void setTarget (TargetInfo *Value)
 Replace the current diagnostics engine.
File Manager

}

{

bool hasFileManager () const
FileManagergetFileManager () const
 Return the current file manager to the caller.
void resetAndLeakFileManager ()
void setFileManager (FileManager *Value)
 setFileManager - Replace the current file manager.
Source Manager

}

{

bool hasSourceManager () const
SourceManagergetSourceManager () const
 Return the current source manager.
void resetAndLeakSourceManager ()
void setSourceManager (SourceManager *Value)
 setSourceManager - Replace the current source manager.
Preprocessor

}

{

bool hasPreprocessor () const
PreprocessorgetPreprocessor () const
 Return the current preprocessor.
void resetAndLeakPreprocessor ()
void setPreprocessor (Preprocessor *Value)
 Replace the current preprocessor.
ASTContext

}

{

bool hasASTContext () const
ASTContextgetASTContext () const
void resetAndLeakASTContext ()
void setASTContext (ASTContext *Value)
 setASTContext - Replace the current AST context.
void setSema (Sema *S)
 Replace the current Sema; the compiler instance takes ownership of S.
ASTConsumer

}

{

bool hasASTConsumer () const
ASTConsumergetASTConsumer () const
ASTConsumertakeASTConsumer ()
void setASTConsumer (ASTConsumer *Value)
Semantic analysis

}

{

bool hasSema () const
SemagetSema () const
SematakeSema ()
Module Management

}

{

ASTReadergetModuleManager () const
Code Completion

}

{

bool hasCodeCompletionConsumer () const
CodeCompleteConsumergetCodeCompletionConsumer () const
CodeCompleteConsumertakeCodeCompletionConsumer ()
void setCodeCompletionConsumer (CodeCompleteConsumer *Value)
Frontend timer

}

{

bool hasFrontendTimer () const
llvm::Timer & getFrontendTimer () const
Output Files

}

{

void addOutputFile (const OutputFile &OutFile)
void clearOutputFiles (bool EraseFiles)

Construction Utility Methods

}

{

void createDiagnostics (int Argc, const char *const *Argv, DiagnosticConsumer *Client=0, bool ShouldOwnClient=true, bool ShouldCloneClient=true)
void createFileManager ()
 Create the file manager and replace any existing one with it.
void createSourceManager (FileManager &FileMgr)
 Create the source manager and replace any existing one with it.
void createPreprocessor ()
void createASTContext ()
 Create the AST context.
void createPCHExternalASTSource (StringRef Path, bool DisablePCHValidation, bool DisableStatCache, bool AllowPCHWithCompilerErrors, void *DeserializationListener)
void createCodeCompletionConsumer ()
void createSema (TranslationUnitKind TUKind, CodeCompleteConsumer *CompletionConsumer)
 Create the Sema object to be used for parsing.
void createFrontendTimer ()
 Create the frontend timer and replace any existing one with it.
llvm::raw_fd_ostream * createDefaultOutputFile (bool Binary=true, StringRef BaseInput="", StringRef Extension="")
llvm::raw_fd_ostream * createOutputFile (StringRef OutputPath, bool Binary=true, bool RemoveFileOnSignal=true, StringRef BaseInput="", StringRef Extension="", bool UseTemporary=false, bool CreateMissingDirectories=false)
static IntrusiveRefCntPtr
< DiagnosticsEngine
createDiagnostics (const DiagnosticOptions &Opts, int Argc, const char *const *Argv, DiagnosticConsumer *Client=0, bool ShouldOwnClient=true, bool ShouldCloneClient=true, const CodeGenOptions *CodeGenOpts=0)
static ExternalASTSourcecreatePCHExternalASTSource (StringRef Path, const std::string &Sysroot, bool DisablePCHValidation, bool DisableStatCache, bool AllowPCHWithCompilerErrors, Preprocessor &PP, ASTContext &Context, void *DeserializationListener, bool Preamble)
static CodeCompleteConsumercreateCodeCompletionConsumer (Preprocessor &PP, const std::string &Filename, unsigned Line, unsigned Column, bool ShowMacros, bool ShowCodePatterns, bool ShowGlobals, raw_ostream &OS)
static llvm::raw_fd_ostream * createOutputFile (StringRef OutputPath, std::string &Error, bool Binary=true, bool RemoveFileOnSignal=true, StringRef BaseInput="", StringRef Extension="", bool UseTemporary=false, bool CreateMissingDirectories=false, std::string *ResultPathName=0, std::string *TempPathName=0)

Initialization Utility Methods

}

{

bool InitializeSourceManager (StringRef InputFile, SrcMgr::CharacteristicKind Kind=SrcMgr::C_User)
virtual ModuleloadModule (SourceLocation ImportLoc, ModuleIdPath Path, Module::NameVisibilityKind Visibility, bool IsInclusionDirective)
 }
static bool InitializeSourceManager (StringRef InputFile, SrcMgr::CharacteristicKind Kind, DiagnosticsEngine &Diags, FileManager &FileMgr, SourceManager &SourceMgr, const FrontendOptions &Opts)

Detailed Description

CompilerInstance - Helper class for managing a single instance of the Clang compiler.

The CompilerInstance serves two purposes: (1) It manages the various objects which are necessary to run the compiler, for example the preprocessor, the target information, and the AST context. (2) It provides utility routines for constructing and manipulating the common Clang objects.

The compiler instance generally owns the instance of all the objects that it manages. However, clients can still share objects by manually setting the object and retaking ownership prior to destroying the CompilerInstance.

The compiler instance is intended to simplify clients, but not to lock them in to the compiler instance for everything. When possible, utility functions come in two forms; a short form that reuses the CompilerInstance objects, and a long form that takes explicit instances of any required objects.

Definition at line 66 of file CompilerInstance.h.


Constructor & Destructor Documentation

CompilerInstance::CompilerInstance ( )

Definition at line 50 of file CompilerInstance.cpp.

CompilerInstance::~CompilerInstance ( )

Definition at line 54 of file CompilerInstance.cpp.


Member Function Documentation

void CompilerInstance::addOutputFile ( const OutputFile &  OutFile)

addOutputFile - Add an output file onto the list of tracked output files.

Parameters:
OutFile- The output file info.

Definition at line 438 of file CompilerInstance.cpp.

Referenced by createOutputFile().

void CompilerInstance::clearOutputFiles ( bool  EraseFiles)

clearOutputFiles - Clear the output file list, destroying the contained output streams.

Parameters:
EraseFiles- If true, attempt to erase the files from disk.

Definition at line 443 of file CompilerInstance.cpp.

References getDiagnostics(), and clang::DiagnosticsEngine::Report().

Referenced by clang::FrontendAction::EndSourceFile().

void CompilerInstance::createASTContext ( )
void CompilerInstance::createCodeCompletionConsumer ( )

Create a code completion consumer using the invocation; note that this will cause the source manager to truncate the input source file at the completion point.

Definition at line 384 of file CompilerInstance.cpp.

References clang::FrontendOptions::CodeCompletionAt, clang::ParsedSourceLocation::Column, EnableCodeCompletion(), clang::ParsedSourceLocation::FileName, clang::Preprocessor::getDiagnostics(), getFrontendOpts(), getPreprocessor(), clang::ParsedSourceLocation::Line, clang::DiagnosticsEngine::Report(), and setCodeCompletionConsumer().

Referenced by clang::ASTFrontendAction::ExecuteAction().

CodeCompleteConsumer * CompilerInstance::createCodeCompletionConsumer ( Preprocessor PP,
const std::string &  Filename,
unsigned  Line,
unsigned  Column,
bool  ShowMacros,
bool  ShowCodePatterns,
bool  ShowGlobals,
raw_ostream &  OS 
) [static]

Create a code completion consumer to print code completion results, at

  • Filename,
  • Line, and
  • Column, to the given output stream
  • OS.

Definition at line 414 of file CompilerInstance.cpp.

References EnableCodeCompletion().

llvm::raw_fd_ostream * CompilerInstance::createDefaultOutputFile ( bool  Binary = true,
StringRef  BaseInput = "",
StringRef  Extension = "" 
)

Create the default output file (from the invocation's options) and add it to the list of tracked output files.

The files created by this function always use temporary files to write to their result (that is, the data is written to a temporary file which will atomically replace the target output on success).

Returns:
- Null on error.

Definition at line 474 of file CompilerInstance.cpp.

References createOutputFile(), and getFrontendOpts().

Referenced by clang::HTMLPrintAction::CreateASTConsumer(), clang::ASTPrintAction::CreateASTConsumer(), clang::ASTDumpXMLAction::CreateASTConsumer(), clang::RewriteObjCAction::CreateASTConsumer(), clang::RewriteMacrosAction::ExecuteAction(), clang::RewriteTestAction::ExecuteAction(), clang::GeneratePTHAction::ExecuteAction(), clang::PrintPreprocessedAction::ExecuteAction(), and GetOutputStream().

void CompilerInstance::createDiagnostics ( int  Argc,
const char *const *  Argv,
DiagnosticConsumer Client = 0,
bool  ShouldOwnClient = true,
bool  ShouldCloneClient = true 
)

Create the diagnostics engine using the invocation's diagnostic options and replace any existing one with it.

Note that this routine also replaces the diagnostic client, allocating one if one is not provided.

Parameters:
ClientIf non-NULL, a diagnostic client that will be attached to (and, then, owned by) the DiagnosticsEngine inside this AST unit.
ShouldOwnClientIf Client is non-NULL, specifies whether the diagnostic object should take ownership of the client.
ShouldCloneClientIf Client is non-NULL, specifies whether that client should be cloned.

Definition at line 170 of file CompilerInstance.cpp.

References getCodeGenOpts(), and getDiagnosticOpts().

Referenced by clang::createInvocationFromCommandLine(), and clang::ASTUnit::LoadFromCommandLine().

IntrusiveRefCntPtr< DiagnosticsEngine > CompilerInstance::createDiagnostics ( const DiagnosticOptions Opts,
int  Argc,
const char *const *  Argv,
DiagnosticConsumer Client = 0,
bool  ShouldOwnClient = true,
bool  ShouldCloneClient = true,
const CodeGenOptions CodeGenOpts = 0 
) [static]

Create a DiagnosticsEngine object with a the TextDiagnosticPrinter.

The

  • Argc and
  • Argv arguments are used only for logging purposes, when the diagnostic options indicate that the compiler should output logging information.

If no diagnostic client is provided, this creates a DiagnosticConsumer that is owned by the returned diagnostic object, if using directly the caller is responsible for releasing the returned DiagnosticsEngine's client eventually.

Parameters:
Opts- The diagnostic options; note that the created text diagnostic object contains a reference to these options and its lifetime must extend past that of the diagnostic engine.
ClientIf non-NULL, a diagnostic client that will be attached to (and, then, owned by) the returned DiagnosticsEngine object.
CodeGenOptsIf non-NULL, the code gen options in use, which may be used by some diagnostics printers (for logging purposes only).
Returns:
The new object on success, or null on failure.

Definition at line 180 of file CompilerInstance.cpp.

References clang::DiagnosticConsumer::clone(), clang::DiagnosticOptions::DiagnosticLogFile, clang::DiagnosticOptions::DiagnosticSerializationFile, clang::DiagnosticOptions::DumpBuildInformation, clang::ProcessWarningOptions(), SetUpBuildDumpLog(), SetUpDiagnosticLog(), SetupSerializedDiagnostics(), and clang::DiagnosticOptions::VerifyDiagnostics.

void CompilerInstance::createFileManager ( )

Create the file manager and replace any existing one with it.

Definition at line 223 of file CompilerInstance.cpp.

References getFileSystemOpts().

Referenced by clang::FrontendAction::BeginSourceFile().

void CompilerInstance::createFrontendTimer ( )

Create the frontend timer and replace any existing one with it.

Definition at line 409 of file CompilerInstance.cpp.

Referenced by ExecuteAction().

llvm::raw_fd_ostream * CompilerInstance::createOutputFile ( StringRef  OutputPath,
bool  Binary = true,
bool  RemoveFileOnSignal = true,
StringRef  BaseInput = "",
StringRef  Extension = "",
bool  UseTemporary = false,
bool  CreateMissingDirectories = false 
)

Create a new output file and add it to the list of tracked output files, optionally deriving the output path name.

Returns:
- Null on error.

Definition at line 483 of file CompilerInstance.cpp.

References addOutputFile(), getDiagnostics(), and clang::DiagnosticsEngine::Report().

Referenced by clang::GeneratePCHAction::ComputeASTConsumerArguments(), clang::GenerateModuleAction::ComputeASTConsumerArguments(), and createDefaultOutputFile().

llvm::raw_fd_ostream * CompilerInstance::createOutputFile ( StringRef  OutputPath,
std::string &  Error,
bool  Binary = true,
bool  RemoveFileOnSignal = true,
StringRef  BaseInput = "",
StringRef  Extension = "",
bool  UseTemporary = false,
bool  CreateMissingDirectories = false,
std::string *  ResultPathName = 0,
std::string *  TempPathName = 0 
) [static]

Create a new output file, optionally deriving the output path name.

If

  • OutputPath is empty, then createOutputFile will derive an output path location as
  • BaseInput, with any suffix removed, and
  • Extension appended. If OutputPath is not stdout and
  • UseTemporary is true, createOutputFile will create a new temporary file that must be renamed to OutputPath in the end.
Parameters:
OutputPath- If given, the path to the output file.
Error[out] - On failure, the error message.
BaseInput- If
  • OutputPath is empty, the input path name to use for deriving the output path.
Extension- The extension to use for derived output names.
Binary- The mode to open the file in.
RemoveFileOnSignal- Whether the file should be registered with llvm::sys::RemoveFileOnSignal. Note that this is not safe for multithreaded use, as the underlying signal mechanism is not reentrant
UseTemporary- Create a new temporary file that must be renamed to OutputPath in the end.
CreateMissingDirectories- When
  • UseTemporary is true, create missing directories in the output path.
ResultPathName[out] - If given, the result path name will be stored here on success.
TempPathName[out] - If given, the temporary file path name will be stored here on success.

Definition at line 512 of file CompilerInstance.cpp.

void CompilerInstance::createPCHExternalASTSource ( StringRef  Path,
bool  DisablePCHValidation,
bool  DisableStatCache,
bool  AllowPCHWithCompilerErrors,
void *  DeserializationListener 
)

Create an external AST source to read a PCH file and attach it to the AST context.

Definition at line 307 of file CompilerInstance.cpp.

References getASTContext(), getHeaderSearchOpts(), getPreprocessor(), getPreprocessorOpts(), clang::PreprocessorOptions::PrecompiledPreambleBytes, and clang::ASTContext::setExternalSource().

Referenced by clang::FrontendAction::BeginSourceFile().

ExternalASTSource * CompilerInstance::createPCHExternalASTSource ( StringRef  Path,
const std::string &  Sysroot,
bool  DisablePCHValidation,
bool  DisableStatCache,
bool  AllowPCHWithCompilerErrors,
Preprocessor PP,
ASTContext Context,
void *  DeserializationListener,
bool  Preamble 
) [static]

Create an external AST source to read a PCH file.

Returns:
- The new object on success, or null on failure.

Definition at line 326 of file CompilerInstance.cpp.

References clang::ASTReader::Failure, clang::ASTReader::IgnorePCH, clang::serialization::MK_PCH, clang::serialization::MK_Preamble, clang::Preprocessor::setPredefines(), and clang::ASTReader::Success.

void CompilerInstance::createPreprocessor ( )
void CompilerInstance::createSema ( TranslationUnitKind  TUKind,
CodeCompleteConsumer CompletionConsumer 
)

Create the Sema object to be used for parsing.

Definition at line 430 of file CompilerInstance.cpp.

References getASTConsumer(), getASTContext(), and getPreprocessor().

Referenced by clang::ASTFrontendAction::ExecuteAction().

void CompilerInstance::createSourceManager ( FileManager FileMgr)

Create the source manager and replace any existing one with it.

Definition at line 229 of file CompilerInstance.cpp.

References getDiagnostics().

Referenced by clang::FrontendAction::BeginSourceFile().

bool CompilerInstance::ExecuteAction ( FrontendAction Act)

ExecuteAction - Execute the provided action against the compiler's CompilerInvocation object.

This function makes the following assumptions:

  • The invocation options should be initialized. This function does not handle the '-help' or '-version' options, clients should handle those directly.
  • The diagnostics engine should have already been created by the client.
  • No other CompilerInstance state should have been initialized (this is an unchecked error).
  • Clients should have initialized any LLVM target features that may be required.
  • Clients should eventually call llvm_shutdown() upon the completion of this routine to ensure that any managed objects are properly destroyed.

Note that this routine may write output to 'stderr'.

Parameters:
Act- The action to execute.
Returns:
- True on success.

Definition at line 635 of file CompilerInstance.cpp.

References clang::FrontendAction::BeginSourceFile(), CLANG_VERSION_STRING, clang::SourceManager::clearIDTables(), createFrontendTimer(), clang::TargetInfo::CreateTargetInfo(), clang::FrontendAction::EndSourceFile(), clang::FrontendAction::Execute(), clang::DiagnosticConsumer::finish(), clang::DiagnosticsEngine::getClient(), getDiagnosticOpts(), getDiagnostics(), getFileManager(), getFrontendOpts(), getHeaderSearchOpts(), getLangOpts(), clang::DiagnosticConsumer::getNumErrors(), clang::DiagnosticConsumer::getNumWarnings(), getSourceManager(), getTarget(), getTargetOpts(), hasDiagnostics(), hasFileManager(), hasSourceManager(), hasTarget(), clang::TargetInfo::noSignedCharForObjCBool(), clang::FileManager::PrintStats(), clang::frontend::RewriteObjC, clang::TargetInfo::setForcedLangOptions(), setTarget(), and clang::FrontendOptions::ShowStats.

Referenced by clang::ExecuteCompilerInvocation().

AnalyzerOptions& clang::CompilerInstance::getAnalyzerOpts ( ) [inline]
const AnalyzerOptions& clang::CompilerInstance::getAnalyzerOpts ( ) const [inline]

Definition at line 195 of file CompilerInstance.h.

ASTConsumer& clang::CompilerInstance::getASTConsumer ( ) const [inline]

Definition at line 386 of file CompilerInstance.h.

Referenced by createSema(), and loadModule().

ASTContext& clang::CompilerInstance::getASTContext ( ) const [inline]
CodeCompleteConsumer& clang::CompilerInstance::getCodeCompletionConsumer ( ) const [inline]

Definition at line 423 of file CompilerInstance.h.

Referenced by clang::ASTFrontendAction::ExecuteAction().

CodeGenOptions& clang::CompilerInstance::getCodeGenOpts ( ) [inline]
const CodeGenOptions& clang::CompilerInstance::getCodeGenOpts ( ) const [inline]

Definition at line 202 of file CompilerInstance.h.

DependencyOutputOptions& clang::CompilerInstance::getDependencyOutputOpts ( ) [inline]

Definition at line 206 of file CompilerInstance.h.

Referenced by createPreprocessor().

const DependencyOutputOptions& clang::CompilerInstance::getDependencyOutputOpts ( ) const [inline]

Definition at line 209 of file CompilerInstance.h.

DiagnosticConsumer& clang::CompilerInstance::getDiagnosticClient ( ) const [inline]
DiagnosticOptions& clang::CompilerInstance::getDiagnosticOpts ( ) [inline]
const DiagnosticOptions& clang::CompilerInstance::getDiagnosticOpts ( ) const [inline]

Definition at line 216 of file CompilerInstance.h.

DiagnosticsEngine& clang::CompilerInstance::getDiagnostics ( ) const [inline]
FileManager& clang::CompilerInstance::getFileManager ( ) const [inline]
const FileSystemOptions& clang::CompilerInstance::getFileSystemOpts ( ) const [inline]
FrontendOptions& clang::CompilerInstance::getFrontendOpts ( ) [inline]
const FrontendOptions& clang::CompilerInstance::getFrontendOpts ( ) const [inline]

Definition at line 227 of file CompilerInstance.h.

llvm::Timer& clang::CompilerInstance::getFrontendTimer ( ) const [inline]

Definition at line 445 of file CompilerInstance.h.

Referenced by clang::FrontendAction::Execute().

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

Definition at line 234 of file CompilerInstance.h.

CompilerInvocation& clang::CompilerInstance::getInvocation ( ) [inline]
LangOptions& clang::CompilerInstance::getLangOpts ( ) [inline]
const LangOptions& clang::CompilerInstance::getLangOpts ( ) const [inline]

Definition at line 241 of file CompilerInstance.h.

ASTReader* clang::CompilerInstance::getModuleManager ( ) const [inline]

Definition at line 415 of file CompilerInstance.h.

Preprocessor& clang::CompilerInstance::getPreprocessor ( ) const [inline]
PreprocessorOptions& clang::CompilerInstance::getPreprocessorOpts ( ) [inline]
const PreprocessorOptions& clang::CompilerInstance::getPreprocessorOpts ( ) const [inline]

Definition at line 248 of file CompilerInstance.h.

PreprocessorOutputOptions& clang::CompilerInstance::getPreprocessorOutputOpts ( ) [inline]

Definition at line 252 of file CompilerInstance.h.

Referenced by clang::PrintPreprocessedAction::ExecuteAction().

const PreprocessorOutputOptions& clang::CompilerInstance::getPreprocessorOutputOpts ( ) const [inline]

Definition at line 255 of file CompilerInstance.h.

Sema& clang::CompilerInstance::getSema ( ) const [inline]

Definition at line 404 of file CompilerInstance.h.

Referenced by clang::ASTFrontendAction::ExecuteAction(), and loadModule().

SourceManager& clang::CompilerInstance::getSourceManager ( ) const [inline]
TargetInfo& clang::CompilerInstance::getTarget ( ) const [inline]
TargetOptions& clang::CompilerInstance::getTargetOpts ( ) [inline]
const TargetOptions& clang::CompilerInstance::getTargetOpts ( ) const [inline]

Definition at line 262 of file CompilerInstance.h.

bool clang::CompilerInstance::hasASTConsumer ( ) const [inline]

Definition at line 384 of file CompilerInstance.h.

Referenced by clang::FrontendAction::BeginSourceFile(), and loadModule().

bool clang::CompilerInstance::hasASTContext ( ) const [inline]

Definition at line 362 of file CompilerInstance.h.

Referenced by clang::FrontendAction::BeginSourceFile(), and loadModule().

bool clang::CompilerInstance::hasCodeCompletionConsumer ( ) const [inline]

Definition at line 421 of file CompilerInstance.h.

Referenced by clang::ASTFrontendAction::ExecuteAction().

bool clang::CompilerInstance::hasDiagnostics ( ) const [inline]

Definition at line 270 of file CompilerInstance.h.

Referenced by ExecuteAction().

bool clang::CompilerInstance::hasFileManager ( ) const [inline]

Definition at line 305 of file CompilerInstance.h.

Referenced by clang::FrontendAction::BeginSourceFile(), and ExecuteAction().

bool clang::CompilerInstance::hasFrontendTimer ( ) const [inline]

Definition at line 443 of file CompilerInstance.h.

Referenced by clang::FrontendAction::Execute().

bool clang::CompilerInstance::hasInvocation ( ) const [inline]

Definition at line 178 of file CompilerInstance.h.

bool clang::CompilerInstance::hasPreprocessor ( ) const [inline]

Definition at line 343 of file CompilerInstance.h.

Referenced by clang::FrontendAction::EndSourceFile().

bool clang::CompilerInstance::hasSema ( ) const [inline]

Definition at line 402 of file CompilerInstance.h.

Referenced by clang::ASTFrontendAction::ExecuteAction(), and loadModule().

bool clang::CompilerInstance::hasSourceManager ( ) const [inline]

Definition at line 324 of file CompilerInstance.h.

Referenced by clang::FrontendAction::BeginSourceFile(), and ExecuteAction().

bool clang::CompilerInstance::hasTarget ( ) const [inline]

Definition at line 291 of file CompilerInstance.h.

Referenced by ExecuteAction().

bool CompilerInstance::InitializeSourceManager ( StringRef  InputFile,
SrcMgr::CharacteristicKind  Kind = SrcMgr::C_User 
)

InitializeSourceManager - Initialize the source manager to set InputFile as the main file.

Returns:
True on success.

Definition at line 594 of file CompilerInstance.cpp.

References getDiagnostics(), getFileManager(), getFrontendOpts(), and getSourceManager().

Referenced by clang::FrontendAction::Execute().

bool CompilerInstance::InitializeSourceManager ( StringRef  InputFile,
SrcMgr::CharacteristicKind  Kind,
DiagnosticsEngine Diags,
FileManager FileMgr,
SourceManager SourceMgr,
const FrontendOptions Opts 
) [static]
Module * CompilerInstance::loadModule ( SourceLocation  ImportLoc,
ModuleIdPath  Path,
Module::NameVisibilityKind  Visibility,
bool  IsInclusionDirective 
) [virtual]
void clang::CompilerInstance::resetAndLeakASTContext ( ) [inline]

Definition at line 369 of file CompilerInstance.h.

Referenced by clang::FrontendAction::EndSourceFile().

void clang::CompilerInstance::resetAndLeakFileManager ( ) [inline]

Definition at line 313 of file CompilerInstance.h.

Referenced by clang::FrontendAction::EndSourceFile().

void clang::CompilerInstance::resetAndLeakPreprocessor ( ) [inline]

Definition at line 351 of file CompilerInstance.h.

Referenced by clang::FrontendAction::EndSourceFile().

void clang::CompilerInstance::resetAndLeakSourceManager ( ) [inline]

Definition at line 332 of file CompilerInstance.h.

Referenced by clang::FrontendAction::EndSourceFile().

void CompilerInstance::setASTConsumer ( ASTConsumer Value)

setASTConsumer - Replace the current AST consumer; the compiler instance takes ownership of

  • Value.

Definition at line 85 of file CompilerInstance.cpp.

Referenced by clang::FrontendAction::BeginSourceFile(), and clang::FrontendAction::EndSourceFile().

void CompilerInstance::setASTContext ( ASTContext Value)

setASTContext - Replace the current AST context.

Definition at line 79 of file CompilerInstance.cpp.

Referenced by clang::FrontendAction::BeginSourceFile(), and clang::FrontendAction::EndSourceFile().

void CompilerInstance::setCodeCompletionConsumer ( CodeCompleteConsumer Value)

setCodeCompletionConsumer - Replace the current code completion consumer; the compiler instance takes ownership of

  • Value.

Definition at line 89 of file CompilerInstance.cpp.

References getFrontendOpts(), and clang::FrontendOptions::SkipFunctionBodies.

Referenced by createCodeCompletionConsumer().

void CompilerInstance::setDiagnostics ( DiagnosticsEngine Value)

setDiagnostics - Replace the current diagnostics engine.

Definition at line 61 of file CompilerInstance.cpp.

void CompilerInstance::setFileManager ( FileManager Value)

setFileManager - Replace the current file manager.

Definition at line 69 of file CompilerInstance.cpp.

Referenced by clang::FixItRecompile::BeginInvocation(), and clang::FrontendAction::BeginSourceFile().

void CompilerInstance::setInvocation ( CompilerInvocation Value)

setInvocation - Replace the current invocation.

Definition at line 57 of file CompilerInstance.cpp.

Referenced by compileModule().

void CompilerInstance::setPreprocessor ( Preprocessor Value)

Replace the current preprocessor.

Definition at line 77 of file CompilerInstance.cpp.

Referenced by clang::FrontendAction::BeginSourceFile().

void CompilerInstance::setSema ( Sema S)

Replace the current Sema; the compiler instance takes ownership of S.

Definition at line 81 of file CompilerInstance.cpp.

Referenced by clang::FrontendAction::EndSourceFile().

void CompilerInstance::setSourceManager ( SourceManager Value)

setSourceManager - Replace the current source manager.

Definition at line 73 of file CompilerInstance.cpp.

Referenced by clang::FixItRecompile::BeginInvocation(), and clang::FrontendAction::BeginSourceFile().

void CompilerInstance::setTarget ( TargetInfo Value)

Replace the current diagnostics engine.

Definition at line 65 of file CompilerInstance.cpp.

Referenced by ExecuteAction().

ASTConsumer* clang::CompilerInstance::takeASTConsumer ( ) [inline]

takeASTConsumer - Remove the current AST consumer and give ownership to the caller.

Definition at line 393 of file CompilerInstance.h.

Referenced by clang::FrontendAction::EndSourceFile().

CodeCompleteConsumer* clang::CompilerInstance::takeCodeCompletionConsumer ( ) [inline]

takeCodeCompletionConsumer - Remove the current code completion consumer and give ownership to the caller.

Definition at line 431 of file CompilerInstance.h.

Sema* clang::CompilerInstance::takeSema ( ) [inline]

Definition at line 409 of file CompilerInstance.h.

Referenced by clang::FrontendAction::EndSourceFile().


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