clang API Documentation
#include <CompilerInstance.h>
Classes | |
struct | OutputFile |
Holds information about the output file. | |
Public Member Functions | |
CompilerInstance (bool BuildingModule=false) | |
~CompilerInstance () | |
High-Level Operations | |
{ | |
bool | ExecuteAction (FrontendAction &Act) |
Compiler Invocation and Options | |
} { | |
bool | hasInvocation () const |
CompilerInvocation & | getInvocation () |
void | setInvocation (CompilerInvocation *Value) |
setInvocation - Replace the current invocation. | |
bool | shouldBuildGlobalModuleIndex () const |
Indicates whether we should (re)build the global module index. | |
void | setBuildGlobalModuleIndex (bool Build) |
Set the flag indicating whether we should (re)build the global module index. | |
Forwarding Methods | |
} { | |
AnalyzerOptionsRef | getAnalyzerOpts () |
CodeGenOptions & | getCodeGenOpts () |
const CodeGenOptions & | getCodeGenOpts () const |
DependencyOutputOptions & | getDependencyOutputOpts () |
const DependencyOutputOptions & | getDependencyOutputOpts () const |
DiagnosticOptions & | getDiagnosticOpts () |
const DiagnosticOptions & | getDiagnosticOpts () const |
const FileSystemOptions & | getFileSystemOpts () const |
FrontendOptions & | getFrontendOpts () |
const FrontendOptions & | getFrontendOpts () const |
HeaderSearchOptions & | getHeaderSearchOpts () |
const HeaderSearchOptions & | getHeaderSearchOpts () const |
LangOptions & | getLangOpts () |
const LangOptions & | getLangOpts () const |
PreprocessorOptions & | getPreprocessorOpts () |
const PreprocessorOptions & | getPreprocessorOpts () const |
PreprocessorOutputOptions & | getPreprocessorOutputOpts () |
const PreprocessorOutputOptions & | getPreprocessorOutputOpts () const |
TargetOptions & | getTargetOpts () |
const TargetOptions & | getTargetOpts () const |
Diagnostics Engine | |
} { | |
bool | hasDiagnostics () const |
DiagnosticsEngine & | getDiagnostics () const |
Get the current diagnostics engine. | |
void | setDiagnostics (DiagnosticsEngine *Value) |
setDiagnostics - Replace the current diagnostics engine. | |
DiagnosticConsumer & | getDiagnosticClient () const |
Target Info | |
} { | |
bool | hasTarget () const |
TargetInfo & | getTarget () const |
void | setTarget (TargetInfo *Value) |
Replace the current diagnostics engine. | |
Virtual File System | |
} { | |
bool | hasVirtualFileSystem () const |
vfs::FileSystem & | getVirtualFileSystem () const |
void | setVirtualFileSystem (IntrusiveRefCntPtr< vfs::FileSystem > FS) |
Replace the current virtual file system. | |
File Manager | |
} { | |
bool | hasFileManager () const |
FileManager & | getFileManager () const |
Return the current file manager to the caller. | |
void | resetAndLeakFileManager () |
void | setFileManager (FileManager *Value) |
Replace the current file manager and virtual file system. | |
Source Manager | |
} { | |
bool | hasSourceManager () const |
SourceManager & | getSourceManager () const |
Return the current source manager. | |
void | resetAndLeakSourceManager () |
void | setSourceManager (SourceManager *Value) |
setSourceManager - Replace the current source manager. | |
Preprocessor | |
} { | |
bool | hasPreprocessor () const |
Preprocessor & | getPreprocessor () const |
Return the current preprocessor. | |
void | resetAndLeakPreprocessor () |
void | setPreprocessor (Preprocessor *Value) |
Replace the current preprocessor. | |
ASTContext | |
} { | |
bool | hasASTContext () const |
ASTContext & | getASTContext () 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 |
ASTConsumer & | getASTConsumer () const |
std::unique_ptr< ASTConsumer > | takeASTConsumer () |
void | setASTConsumer (std::unique_ptr< ASTConsumer > Value) |
Semantic analysis | |
} { | |
bool | hasSema () const |
Sema & | getSema () const |
std::unique_ptr< Sema > | takeSema () |
void | resetAndLeakSema () |
Module Management | |
} { | |
IntrusiveRefCntPtr< ASTReader > | getModuleManager () const |
void | setModuleManager (IntrusiveRefCntPtr< ASTReader > Reader) |
std::shared_ptr < ModuleDependencyCollector > | getModuleDepCollector () const |
void | setModuleDepCollector (std::shared_ptr< ModuleDependencyCollector > Collector) |
Code Completion | |
} { | |
bool | hasCodeCompletionConsumer () const |
CodeCompleteConsumer & | getCodeCompletionConsumer () const |
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 (DiagnosticConsumer *Client=nullptr, bool ShouldOwnClient=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 (TranslationUnitKind TUKind) |
void | createASTContext () |
Create the AST context. | |
void | createPCHExternalASTSource (StringRef Path, bool DisablePCHValidation, bool AllowPCHWithCompilerErrors, void *DeserializationListener, bool OwnDeserializationListener) |
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, bool RemoveFileOnSignal, StringRef BaseInput, StringRef Extension, bool UseTemporary, bool CreateMissingDirectories=false) |
llvm::raw_null_ostream * | createNullOutputFile () |
static IntrusiveRefCntPtr < DiagnosticsEngine > | createDiagnostics (DiagnosticOptions *Opts, DiagnosticConsumer *Client=nullptr, bool ShouldOwnClient=true, const CodeGenOptions *CodeGenOpts=nullptr) |
static ExternalASTSource * | createPCHExternalASTSource (StringRef Path, const std::string &Sysroot, bool DisablePCHValidation, bool AllowPCHWithCompilerErrors, Preprocessor &PP, ASTContext &Context, void *DeserializationListener, bool OwnDeserializationListener, bool Preamble, bool UseGlobalModuleIndex) |
static CodeCompleteConsumer * | createCodeCompletionConsumer (Preprocessor &PP, const std::string &Filename, unsigned Line, unsigned Column, const CodeCompleteOptions &Opts, raw_ostream &OS) |
static llvm::raw_fd_ostream * | createOutputFile (StringRef OutputPath, std::error_code &Error, bool Binary, bool RemoveFileOnSignal, StringRef BaseInput, StringRef Extension, bool UseTemporary, bool CreateMissingDirectories, std::string *ResultPathName, std::string *TempPathName) |
Initialization Utility Methods | |
{ | |
bool | InitializeSourceManager (const FrontendInputFile &Input) |
void | createModuleManager () |
} | |
bool | loadModuleFile (StringRef FileName) |
ModuleLoadResult | loadModule (SourceLocation ImportLoc, ModuleIdPath Path, Module::NameVisibilityKind Visibility, bool IsInclusionDirective) override |
Attempt to load the given module. | |
void | makeModuleVisible (Module *Mod, Module::NameVisibilityKind Visibility, SourceLocation ImportLoc, bool Complain) override |
Make the given module visible. | |
bool | hadModuleLoaderFatalFailure () const |
GlobalModuleIndex * | loadGlobalModuleIndex (SourceLocation TriggerLoc) override |
Load, create, or return global module. This function returns an existing global module index, if one had already been loaded or created, or loads one if it exists, or creates one if it doesn't exist. Also, importantly, if the index doesn't cover all the modules in the module map, it will be update to do so here, because of its use in searching for needed module imports and associated fixit messages. | |
bool | lookupMissingImports (StringRef Name, SourceLocation TriggerLoc) override |
void | addDependencyCollector (std::shared_ptr< DependencyCollector > Listener) |
static bool | InitializeSourceManager (const FrontendInputFile &Input, DiagnosticsEngine &Diags, FileManager &FileMgr, SourceManager &SourceMgr, const FrontendOptions &Opts) |
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 69 of file CompilerInstance.h.
Definition at line 54 of file CompilerInstance.cpp.
Definition at line 61 of file CompilerInstance.cpp.
void clang::CompilerInstance::addDependencyCollector | ( | std::shared_ptr< DependencyCollector > | Listener | ) | [inline] |
Definition at line 714 of file CompilerInstance.h.
void CompilerInstance::addOutputFile | ( | const OutputFile & | OutFile | ) |
addOutputFile - Add an output file onto the list of tracked output files.
OutFile | - The output file info. |
Definition at line 517 of file CompilerInstance.cpp.
Referenced by createNullOutputFile(), and createOutputFile().
void CompilerInstance::clearOutputFiles | ( | bool | EraseFiles | ) |
clearOutputFiles - Clear the output file list, destroying the contained output streams.
EraseFiles | - If true, attempt to erase the files from disk. |
Definition at line 522 of file CompilerInstance.cpp.
References getDiagnostics(), and clang::DiagnosticsEngine::Report().
Referenced by clang::FrontendAction::BeginSourceFile(), and clang::FrontendAction::EndSourceFile().
void CompilerInstance::createASTContext | ( | ) |
Create the AST context.
Definition at line 378 of file CompilerInstance.cpp.
References Context, clang::Preprocessor::getBuiltinInfo(), clang::Preprocessor::getIdentifierTable(), getLangOpts(), getPreprocessor(), clang::Preprocessor::getSelectorTable(), clang::Preprocessor::getSourceManager(), getTarget(), and clang::ASTContext::InitBuiltinTypes().
Referenced by clang::FrontendAction::BeginSourceFile(), and createModuleManager().
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 468 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, | ||
const CodeCompleteOptions & | Opts, | ||
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 496 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).
Definition at line 551 of file CompilerInstance.cpp.
References createOutputFile(), and getFrontendOpts().
Referenced by clang::HTMLPrintAction::CreateASTConsumer(), clang::ASTPrintAction::CreateASTConsumer(), clang::RewriteMacrosAction::ExecuteAction(), clang::RewriteTestAction::ExecuteAction(), clang::RewriteIncludesAction::ExecuteAction(), clang::GeneratePTHAction::ExecuteAction(), clang::PrintPreprocessedAction::ExecuteAction(), and GetOutputStream().
void CompilerInstance::createDiagnostics | ( | DiagnosticConsumer * | Client = nullptr , |
bool | ShouldOwnClient = 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.
Client | If non-NULL, a diagnostic client that will be attached to (and, then, owned by) the DiagnosticsEngine inside this AST unit. |
ShouldOwnClient | If Client is non-NULL, specifies whether the diagnostic object should take ownership of the client. |
Definition at line 181 of file CompilerInstance.cpp.
References getCodeGenOpts(), and getDiagnosticOpts().
Referenced by clang::createInvocationFromCommandLine(), and clang::tooling::FrontendActionFactory::runInvocation().
IntrusiveRefCntPtr< DiagnosticsEngine > CompilerInstance::createDiagnostics | ( | DiagnosticOptions * | Opts, |
DiagnosticConsumer * | Client = nullptr , |
||
bool | ShouldOwnClient = true , |
||
const CodeGenOptions * | CodeGenOpts = nullptr |
||
) | [static] |
Create a DiagnosticsEngine object with a the TextDiagnosticPrinter.
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.
Opts | - The diagnostic options; note that the created text diagnostic object contains a reference to these options. |
Client | If non-NULL, a diagnostic client that will be attached to (and, then, owned by) the returned DiagnosticsEngine object. |
CodeGenOpts | If non-NULL, the code gen options in use, which may be used by some diagnostics printers (for logging purposes only). |
Definition at line 188 of file CompilerInstance.cpp.
References clang::DiagnosticOptions::DiagnosticSerializationFile, clang::ProcessWarningOptions(), SetUpDiagnosticLog(), and SetupSerializedDiagnostics().
void CompilerInstance::createFileManager | ( | ) |
Create the file manager and replace any existing one with it.
Definition at line 223 of file CompilerInstance.cpp.
References getFileSystemOpts(), clang::vfs::getRealFileSystem(), hasVirtualFileSystem(), and setVirtualFileSystem().
Referenced by clang::FrontendAction::BeginSourceFile().
Create the frontend timer and replace any existing one with it.
Definition at line 491 of file CompilerInstance.cpp.
Referenced by ExecuteAction().
}
Definition at line 1225 of file CompilerInstance.cpp.
References Context, createASTContext(), clang::PreprocessorOptions::DisablePCHValidation, getASTConsumer(), getASTContext(), getFrontendOpts(), getHeaderSearchOpts(), getPreprocessor(), getPreprocessorOpts(), getSema(), getSourceManager(), hasASTConsumer(), hasASTContext(), hasSema(), clang::HeaderSearchOptions::ModulesValidateSystemHeaders, pruneModuleCache(), clang::ASTContext::setASTMutationListener(), clang::ASTContext::setExternalSource(), clang::HeaderSearchOptions::Sysroot, and clang::FrontendOptions::UseGlobalModuleIndex.
Referenced by clang::FrontendAction::BeginSourceFile(), loadGlobalModuleIndex(), and loadModule().
llvm::raw_null_ostream * CompilerInstance::createNullOutputFile | ( | ) |
Definition at line 559 of file CompilerInstance.cpp.
References addOutputFile().
Referenced by GetOutputStream().
llvm::raw_fd_ostream * CompilerInstance::createOutputFile | ( | StringRef | OutputPath, |
bool | Binary, | ||
bool | RemoveFileOnSignal, | ||
StringRef | BaseInput, | ||
StringRef | Extension, | ||
bool | UseTemporary, | ||
bool | CreateMissingDirectories = false |
||
) |
Create a new output file and add it to the list of tracked output files, optionally deriving the output path name.
Definition at line 566 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::error_code & | Error, | ||
bool | Binary, | ||
bool | RemoveFileOnSignal, | ||
StringRef | BaseInput, | ||
StringRef | Extension, | ||
bool | UseTemporary, | ||
bool | CreateMissingDirectories, | ||
std::string * | ResultPathName, | ||
std::string * | TempPathName | ||
) | [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.
OutputPath | - If given, the path to the output file. |
Error | [out] - On failure, the error. |
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 591 of file CompilerInstance.cpp.
void CompilerInstance::createPCHExternalASTSource | ( | StringRef | Path, |
bool | DisablePCHValidation, | ||
bool | AllowPCHWithCompilerErrors, | ||
void * | DeserializationListener, | ||
bool | OwnDeserializationListener | ||
) |
Create an external AST source to read a PCH file and attach it to the AST context.
Definition at line 388 of file CompilerInstance.cpp.
References getASTContext(), getFrontendOpts(), 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 | AllowPCHWithCompilerErrors, | ||
Preprocessor & | PP, | ||
ASTContext & | Context, | ||
void * | DeserializationListener, | ||
bool | OwnDeserializationListener, | ||
bool | Preamble, | ||
bool | UseGlobalModuleIndex | ||
) | [static] |
Create an external AST source to read a PCH file.
Definition at line 402 of file CompilerInstance.cpp.
References clang::ASTReader::ARR_None, clang::ASTReader::ConfigurationMismatch, clang::ASTReader::Failure, clang::Preprocessor::getHeaderSearchInfo(), clang::HeaderSearch::getHeaderSearchOpts(), clang::ASTReader::HadErrors, clang::ASTReader::Missing, clang::serialization::MK_PCH, clang::serialization::MK_Preamble, clang::HeaderSearchOptions::ModulesValidateSystemHeaders, clang::ASTReader::OutOfDate, clang::Preprocessor::setPredefines(), clang::ASTReader::Success, and clang::ASTReader::VersionMismatch.
void CompilerInstance::createPreprocessor | ( | TranslationUnitKind | TUKind | ) |
Create the preprocessor, using the invocation, file, and source managers, and replace any existing one with it.
Definition at line 289 of file CompilerInstance.cpp.
References clang::ApplyHeaderSearchOptions(), clang::AttachDependencyGraphGen(), clang::AttachHeaderIncludeGen(), clang::PTHManager::Create(), clang::DependencyFileGenerator::CreateAndAttachToPreprocessor(), clang::PreprocessorOptions::DetailedRecord, clang::DependencyOutputOptions::DOTOutputFile, getDependencyOutputOpts(), getDiagnostics(), getFrontendOpts(), getHeaderSearchOpts(), getInvocation(), getLangOpts(), getPreprocessorOpts(), getPreprocessorOutputOpts(), getSourceManager(), getTarget(), clang::DependencyOutputOptions::HeaderIncludeOutputFile, InitializeFileRemapping(), clang::InitializePreprocessor(), clang::DependencyOutputOptions::ModuleDependencyOutputDir, clang::DependencyOutputOptions::OutputFile, clang::DependencyOutputOptions::PrintShowIncludes, clang::PTHManager::setPreprocessor(), clang::DependencyOutputOptions::ShowHeaderIncludes, clang::HeaderSearchOptions::Sysroot, and clang::PreprocessorOptions::TokenCache.
Referenced by clang::FrontendAction::BeginSourceFile().
void CompilerInstance::createSema | ( | TranslationUnitKind | TUKind, |
CodeCompleteConsumer * | CompletionConsumer | ||
) |
Create the Sema object to be used for parsing.
Definition at line 509 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 233 of file CompilerInstance.cpp.
References getDiagnostics(), and SourceMgr.
Referenced by clang::FrontendAction::BeginSourceFile(), and clang::tooling::FrontendActionFactory::runInvocation().
ExecuteAction - Execute the provided action against the compiler's CompilerInvocation object.
This function makes the following assumptions:
Note that this routine may write output to 'stderr'.
Act | - The action to execute. |
Definition at line 759 of file CompilerInstance.cpp.
References clang::TargetInfo::adjust(), 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(), getInvocation(), getLangOpts(), clang::DiagnosticConsumer::getNumErrors(), clang::DiagnosticConsumer::getNumWarnings(), getSourceManager(), getTarget(), hasDiagnostics(), hasFileManager(), hasSourceManager(), hasTarget(), clang::FrontendAction::isModelParsingAction(), clang::TargetInfo::noSignedCharForObjCBool(), clang::FileManager::PrintStats(), clang::frontend::RewriteObjC, setTarget(), and clang::FrontendOptions::ShowStats.
Referenced by clang::ExecuteCompilerInvocation(), and clang::tooling::FrontendActionFactory::runInvocation().
Definition at line 228 of file CompilerInstance.h.
Referenced by clang::ento::CreateAnalysisConsumer(), and clang::ExecuteCompilerInvocation().
ASTConsumer& clang::CompilerInstance::getASTConsumer | ( | ) | const [inline] |
Definition at line 443 of file CompilerInstance.h.
Referenced by createModuleManager(), and createSema().
ASTContext& clang::CompilerInstance::getASTContext | ( | ) | const [inline] |
Definition at line 420 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), createASTReader(), createModuleManager(), createPCHExternalASTSource(), createSema(), clang::VerifyPCHAction::ExecuteAction(), clang::ASTMergeAction::ExecuteAction(), and loadModule().
CodeCompleteConsumer& clang::CompilerInstance::getCodeCompletionConsumer | ( | ) | const [inline] |
Definition at line 486 of file CompilerInstance.h.
Referenced by clang::ASTFrontendAction::ExecuteAction().
CodeGenOptions& clang::CompilerInstance::getCodeGenOpts | ( | ) | [inline] |
Definition at line 232 of file CompilerInstance.h.
Referenced by clang::CodeGenAction::CreateASTConsumer(), createDiagnostics(), and clang::CodeGenAction::ExecuteAction().
const CodeGenOptions& clang::CompilerInstance::getCodeGenOpts | ( | ) | const [inline] |
Definition at line 235 of file CompilerInstance.h.
Definition at line 239 of file CompilerInstance.h.
Referenced by createPreprocessor().
const DependencyOutputOptions& clang::CompilerInstance::getDependencyOutputOpts | ( | ) | const [inline] |
Definition at line 242 of file CompilerInstance.h.
DiagnosticConsumer& clang::CompilerInstance::getDiagnosticClient | ( | ) | const [inline] |
Definition at line 314 of file CompilerInstance.h.
Referenced by clang::FixItRecompile::BeginInvocation(), clang::FrontendAction::BeginSourceFile(), compileModuleImpl(), and clang::FrontendAction::EndSourceFile().
DiagnosticOptions& clang::CompilerInstance::getDiagnosticOpts | ( | ) | [inline] |
Definition at line 246 of file CompilerInstance.h.
Referenced by clang::createChainedIncludesSource(), createDiagnostics(), clang::ASTMergeAction::ExecuteAction(), and ExecuteAction().
const DiagnosticOptions& clang::CompilerInstance::getDiagnosticOpts | ( | ) | const [inline] |
Definition at line 249 of file CompilerInstance.h.
DiagnosticsEngine& clang::CompilerInstance::getDiagnostics | ( | ) | const [inline] |
Get the current diagnostics engine.
Definition at line 306 of file CompilerInstance.h.
Referenced by clang::arcmt::CheckAction::BeginInvocation(), clang::arcmt::ModifyAction::BeginInvocation(), clang::arcmt::MigrateSourceAction::BeginInvocation(), clang::arcmt::MigrateAction::BeginInvocation(), clang::FixItRecompile::BeginInvocation(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), clang::FrontendAction::BeginSourceFile(), clang::FixItAction::BeginSourceFileAction(), clang::GenerateModuleAction::BeginSourceFileAction(), clearOutputFiles(), compileAndLoadModule(), compileModuleImpl(), clang::GeneratePCHAction::ComputeASTConsumerArguments(), clang::CodeGenAction::CreateASTConsumer(), CreateFrontendBaseAction(), createOutputFile(), createPreprocessor(), createSourceManager(), clang::CodeGenAction::ExecuteAction(), clang::ASTMergeAction::ExecuteAction(), ExecuteAction(), clang::ExecuteCompilerInvocation(), InitializeSourceManager(), loadModule(), loadModuleFile(), and clang::FrontendAction::shouldEraseOutputFiles().
FileManager& clang::CompilerInstance::getFileManager | ( | ) | const [inline] |
Return the current file manager to the caller.
Definition at line 361 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), clang::GenerateModuleAction::BeginSourceFileAction(), compileModuleImpl(), clang::CodeGenAction::CreateASTConsumer(), clang::arcmt::MigrateSourceAction::CreateASTConsumer(), clang::arcmt::ObjCMigrateAction::CreateASTConsumer(), clang::FrontendAction::Execute(), clang::ASTMergeAction::ExecuteAction(), ExecuteAction(), clang::PrintPreambleAction::ExecuteAction(), InitializeSourceManager(), loadGlobalModuleIndex(), and loadModuleFile().
const FileSystemOptions& clang::CompilerInstance::getFileSystemOpts | ( | ) | const [inline] |
Definition at line 253 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), createFileManager(), and clang::ASTMergeAction::ExecuteAction().
FrontendOptions& clang::CompilerInstance::getFrontendOpts | ( | ) | [inline] |
Definition at line 257 of file CompilerInstance.h.
Referenced by clang::FixItRecompile::BeginInvocation(), clang::FrontendAction::BeginSourceFile(), clang::FixItAction::BeginSourceFileAction(), compileModuleImpl(), clang::GeneratePCHAction::ComputeASTConsumerArguments(), clang::GenerateModuleAction::ComputeASTConsumerArguments(), clang::ento::CreateAnalysisConsumer(), clang::CodeGenAction::CreateASTConsumer(), clang::arcmt::MigrateSourceAction::CreateASTConsumer(), clang::ASTPrintAction::CreateASTConsumer(), clang::ASTDumpAction::CreateASTConsumer(), clang::GeneratePCHAction::CreateASTConsumer(), clang::createChainedIncludesSource(), createCodeCompletionConsumer(), createDefaultOutputFile(), CreateFrontendAction(), CreateFrontendBaseAction(), createModuleManager(), createPCHExternalASTSource(), createPreprocessor(), clang::FrontendAction::EndSourceFile(), clang::DumpModuleInfoAction::ExecuteAction(), ExecuteAction(), clang::GeneratePTHAction::ExecuteAction(), clang::ASTFrontendAction::ExecuteAction(), clang::ExecuteCompilerInvocation(), InitializeSourceManager(), and shouldBuildGlobalModuleIndex().
const FrontendOptions& clang::CompilerInstance::getFrontendOpts | ( | ) | const [inline] |
Definition at line 260 of file CompilerInstance.h.
llvm::Timer& clang::CompilerInstance::getFrontendTimer | ( | ) | const [inline] |
Definition at line 502 of file CompilerInstance.h.
Referenced by clang::FrontendAction::Execute().
Definition at line 264 of file CompilerInstance.h.
Referenced by clang::GeneratePCHAction::ComputeASTConsumerArguments(), createModuleManager(), createPCHExternalASTSource(), createPreprocessor(), clang::VerifyPCHAction::ExecuteAction(), and ExecuteAction().
const HeaderSearchOptions& clang::CompilerInstance::getHeaderSearchOpts | ( | ) | const [inline] |
Definition at line 267 of file CompilerInstance.h.
CompilerInvocation& clang::CompilerInstance::getInvocation | ( | ) | [inline] |
Definition at line 207 of file CompilerInstance.h.
Referenced by clang::arcmt::CheckAction::BeginInvocation(), clang::arcmt::ModifyAction::BeginInvocation(), clang::arcmt::MigrateAction::BeginInvocation(), clang::FrontendAction::BeginSourceFile(), compileModuleImpl(), clang::createChainedIncludesSource(), createPreprocessor(), and ExecuteAction().
LangOptions& clang::CompilerInstance::getLangOpts | ( | ) | [inline] |
Definition at line 271 of file CompilerInstance.h.
Referenced by clang::FixItRecompile::BeginInvocation(), clang::FrontendAction::BeginSourceFile(), clang::FixItAction::BeginSourceFileAction(), clang::GenerateModuleAction::BeginSourceFileAction(), clang::GenerateModuleAction::ComputeASTConsumerArguments(), clang::CodeGenAction::CreateASTConsumer(), createASTContext(), createPreprocessor(), clang::CodeGenAction::ExecuteAction(), ExecuteAction(), clang::PrintPreambleAction::ExecuteAction(), and loadModule().
const LangOptions& clang::CompilerInstance::getLangOpts | ( | ) | const [inline] |
Definition at line 274 of file CompilerInstance.h.
std::shared_ptr< ModuleDependencyCollector > CompilerInstance::getModuleDepCollector | ( | ) | const |
Definition at line 124 of file CompilerInstance.cpp.
Referenced by compileModuleImpl().
IntrusiveRefCntPtr< ASTReader > CompilerInstance::getModuleManager | ( | ) | const |
Definition at line 116 of file CompilerInstance.cpp.
Referenced by clang::FrontendAction::BeginSourceFile(), and compileAndLoadModule().
Preprocessor& clang::CompilerInstance::getPreprocessor | ( | ) | const [inline] |
Return the current preprocessor.
Definition at line 401 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), clang::GenerateModuleAction::BeginSourceFileAction(), compileModuleImpl(), clang::GenerateModuleAction::ComputeASTConsumerArguments(), clang::ento::CreateAnalysisConsumer(), clang::HTMLPrintAction::CreateASTConsumer(), clang::CodeGenAction::CreateASTConsumer(), clang::arcmt::MigrateSourceAction::CreateASTConsumer(), clang::arcmt::ObjCMigrateAction::CreateASTConsumer(), clang::GeneratePCHAction::CreateASTConsumer(), clang::GenerateModuleAction::CreateASTConsumer(), createASTContext(), createASTReader(), createCodeCompletionConsumer(), createModuleManager(), createPCHExternalASTSource(), createSema(), clang::FrontendAction::EndSourceFile(), clang::FrontendAction::Execute(), clang::RewriteMacrosAction::ExecuteAction(), clang::RewriteTestAction::ExecuteAction(), clang::RewriteIncludesAction::ExecuteAction(), clang::VerifyPCHAction::ExecuteAction(), clang::DumpRawTokensAction::ExecuteAction(), clang::DumpTokensAction::ExecuteAction(), clang::GeneratePTHAction::ExecuteAction(), clang::PreprocessOnlyAction::ExecuteAction(), clang::PrintPreprocessedAction::ExecuteAction(), loadGlobalModuleIndex(), and loadModule().
Definition at line 278 of file CompilerInstance.h.
Referenced by clang::FixItRecompile::BeginInvocation(), clang::FrontendAction::BeginSourceFile(), clang::createChainedIncludesSource(), createModuleManager(), createPCHExternalASTSource(), createPreprocessor(), clang::VerifyPCHAction::ExecuteAction(), and loadModule().
const PreprocessorOptions& clang::CompilerInstance::getPreprocessorOpts | ( | ) | const [inline] |
Definition at line 281 of file CompilerInstance.h.
Definition at line 285 of file CompilerInstance.h.
Referenced by CreateFrontendBaseAction(), createPreprocessor(), clang::RewriteIncludesAction::ExecuteAction(), and clang::PrintPreprocessedAction::ExecuteAction().
const PreprocessorOutputOptions& clang::CompilerInstance::getPreprocessorOutputOpts | ( | ) | const [inline] |
Definition at line 288 of file CompilerInstance.h.
Sema& clang::CompilerInstance::getSema | ( | ) | const [inline] |
Definition at line 461 of file CompilerInstance.h.
Referenced by createModuleManager(), and clang::ASTFrontendAction::ExecuteAction().
SourceManager& clang::CompilerInstance::getSourceManager | ( | ) | const [inline] |
Return the current source manager.
Definition at line 381 of file CompilerInstance.h.
Referenced by clang::FixItRecompile::BeginInvocation(), clang::FixItAction::BeginSourceFileAction(), clang::GenerateModuleAction::BeginSourceFileAction(), compileModuleImpl(), clang::arcmt::MigrateSourceAction::CreateASTConsumer(), clang::arcmt::ObjCMigrateAction::CreateASTConsumer(), createModuleManager(), createPreprocessor(), clang::FrontendAction::EndSourceFile(), clang::CodeGenAction::ExecuteAction(), ExecuteAction(), clang::PrintPreprocessedAction::ExecuteAction(), InitializeSourceManager(), and loadModule().
TargetInfo& clang::CompilerInstance::getTarget | ( | ) | const [inline] |
Definition at line 326 of file CompilerInstance.h.
Referenced by clang::GenerateModuleAction::BeginSourceFileAction(), createASTContext(), createPreprocessor(), clang::CodeGenAction::ExecuteAction(), ExecuteAction(), and loadModule().
TargetOptions& clang::CompilerInstance::getTargetOpts | ( | ) | [inline] |
Definition at line 292 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), clang::CodeGenAction::CreateASTConsumer(), and clang::CodeGenAction::ExecuteAction().
const TargetOptions& clang::CompilerInstance::getTargetOpts | ( | ) | const [inline] |
Definition at line 295 of file CompilerInstance.h.
vfs::FileSystem& clang::CompilerInstance::getVirtualFileSystem | ( | ) | const [inline] |
Definition at line 340 of file CompilerInstance.h.
References hasVirtualFileSystem().
Referenced by compileModuleImpl().
bool clang::CompilerInstance::hadModuleLoaderFatalFailure | ( | ) | const [inline] |
Definition at line 706 of file CompilerInstance.h.
References clang::ModuleLoader::HadFatalFailure.
bool clang::CompilerInstance::hasASTConsumer | ( | ) | const [inline] |
Definition at line 441 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), and createModuleManager().
bool clang::CompilerInstance::hasASTContext | ( | ) | const [inline] |
Definition at line 418 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), createModuleManager(), and loadModule().
bool clang::CompilerInstance::hasCodeCompletionConsumer | ( | ) | const [inline] |
Definition at line 484 of file CompilerInstance.h.
Referenced by clang::ASTFrontendAction::ExecuteAction().
bool clang::CompilerInstance::hasDiagnostics | ( | ) | const [inline] |
Definition at line 303 of file CompilerInstance.h.
Referenced by ExecuteAction(), and clang::tooling::FrontendActionFactory::runInvocation().
bool clang::CompilerInstance::hasFileManager | ( | ) | const [inline] |
Definition at line 358 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), clang::FrontendAction::Execute(), ExecuteAction(), and loadGlobalModuleIndex().
bool clang::CompilerInstance::hasFrontendTimer | ( | ) | const [inline] |
Definition at line 500 of file CompilerInstance.h.
Referenced by clang::FrontendAction::Execute().
bool clang::CompilerInstance::hasInvocation | ( | ) | const [inline] |
Definition at line 205 of file CompilerInstance.h.
bool clang::CompilerInstance::hasPreprocessor | ( | ) | const [inline] |
Definition at line 398 of file CompilerInstance.h.
Referenced by clang::FrontendAction::EndSourceFile(), clang::FrontendAction::Execute(), clang::ASTFrontendAction::ExecuteAction(), and loadGlobalModuleIndex().
bool clang::CompilerInstance::hasSema | ( | ) | const [inline] |
Definition at line 459 of file CompilerInstance.h.
Referenced by createModuleManager(), and clang::ASTFrontendAction::ExecuteAction().
bool clang::CompilerInstance::hasSourceManager | ( | ) | const [inline] |
Definition at line 378 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), and ExecuteAction().
bool clang::CompilerInstance::hasTarget | ( | ) | const [inline] |
Definition at line 324 of file CompilerInstance.h.
Referenced by ExecuteAction().
bool clang::CompilerInstance::hasVirtualFileSystem | ( | ) | const [inline] |
Definition at line 338 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), createFileManager(), and getVirtualFileSystem().
bool CompilerInstance::InitializeSourceManager | ( | const FrontendInputFile & | Input | ) |
InitializeSourceManager - Initialize the source manager to set InputFile as the main file.
Definition at line 684 of file CompilerInstance.cpp.
References getDiagnostics(), getFileManager(), getFrontendOpts(), and getSourceManager().
Referenced by clang::FrontendAction::BeginSourceFile().
bool CompilerInstance::InitializeSourceManager | ( | const FrontendInputFile & | Input, |
DiagnosticsEngine & | Diags, | ||
FileManager & | FileMgr, | ||
SourceManager & | SourceMgr, | ||
const FrontendOptions & | Opts | ||
) | [static] |
InitializeSourceManager - Initialize the source manager to set InputFile as the main file.
Definition at line 690 of file CompilerInstance.cpp.
References clang::SrcMgr::C_System, clang::SrcMgr::C_User, clang::SourceManager::createFileID(), clang::FrontendInputFile::getBuffer(), clang::FileManager::getBufferForFile(), clang::FrontendInputFile::getFile(), clang::FileManager::getFile(), clang::SourceManager::getMainFileID(), clang::FileManager::getVirtualFile(), clang::FrontendInputFile::isBuffer(), clang::FileID::isInvalid(), clang::FileEntry::isNamedPipe(), clang::FrontendInputFile::isSystem(), clang::SourceManager::overrideFileContents(), clang::DiagnosticsEngine::Report(), and clang::SourceManager::setMainFileID().
GlobalModuleIndex * CompilerInstance::loadGlobalModuleIndex | ( | SourceLocation | TriggerLoc | ) | [override, virtual] |
Load, create, or return global module. This function returns an existing global module index, if one had already been loaded or created, or loads one if it exists, or creates one if it doesn't exist. Also, importantly, if the index doesn't cover all the modules in the module map, it will be update to do so here, because of its use in searching for needed module imports and associated fixit messages.
TriggerLoc | The location for what triggered the load. |
Implements clang::ModuleLoader.
Definition at line 1608 of file CompilerInstance.cpp.
References clang::ModuleLoader::buildingModule(), createModuleManager(), clang::Module::DefinitionLoc, clang::Module::getASTFile(), getFileManager(), clang::Preprocessor::getHeaderSearchInfo(), clang::HeaderSearch::getModuleMap(), getPreprocessor(), hasFileManager(), hasPreprocessor(), clang::Module::Hidden, loadModule(), clang::ModuleMap::module_begin(), clang::ModuleMap::module_end(), clang::Module::Name, shouldBuildGlobalModuleIndex(), and clang::GlobalModuleIndex::writeIndex().
Referenced by lookupMissingImports().
ModuleLoadResult CompilerInstance::loadModule | ( | SourceLocation | ImportLoc, |
ModuleIdPath | Path, | ||
Module::NameVisibilityKind | Visibility, | ||
bool | IsInclusionDirective | ||
) | [override, virtual] |
Attempt to load the given module.
This routine attempts to load the module described by the given parameters.
ImportLoc | The location of the 'import' keyword. |
Path | The identifiers (and their locations) of the module "path", e.g., "std.vector" would be split into "std" and "vector". |
Visibility | The visibility provided for the names in the loaded module. |
IsInclusionDirective | Indicates that this module is being loaded implicitly, due to the presence of an inclusion directive. Otherwise, it is being loaded due to an import declaration. |
Implements clang::ModuleLoader.
Definition at line 1320 of file CompilerInstance.cpp.
References clang::DeclContext::addDecl(), clang::ASTReader::ARR_Missing, clang::ASTReader::ARR_OutOfDate, BestEditDistance, checkConfigMacro(), compileAndLoadModule(), clang::Module::ConfigMacros, clang::ASTReader::ConfigurationMismatch, clang::ImportDecl::CreateImplicit(), createModuleManager(), clang::FixItHint::CreateReplacement(), clang::LangOptions::CurrentModule, clang::PreprocessorOptions::FailedModules, clang::ASTReader::Failure, clang::Module::HeaderDirective::FileName, clang::Module::HeaderDirective::FileNameLoc, clang::Module::findSubmodule(), getASTContext(), getDiagnostics(), clang::Module::getFullModuleName(), getLangOpts(), clang::SourceManager::getModuleBuildStack(), getPreprocessor(), getPreprocessorOpts(), getSourceManager(), getTarget(), clang::Module::getTopLevelModule(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTReader::HadErrors, clang::ModuleLoader::HadFatalFailure, hasASTContext(), clang::LangOptions::ImplementationOfModule, clang::Module::isAvailable(), clang::Module::IsFromModuleFile, clang::SourceLocation::isInvalid(), clang::Module::HeaderDirective::IsUmbrella, clang::SourceLocation::isValid(), clang::ASTReader::Missing, clang::serialization::MK_ExplicitModule, clang::serialization::MK_ImplicitModule, clang::ASTReader::OutOfDate, clang::DiagnosticsEngine::Report(), clang::Module::submodule_begin(), clang::Module::submodule_end(), clang::ASTReader::Success, and clang::ASTReader::VersionMismatch.
Referenced by loadGlobalModuleIndex().
bool CompilerInstance::loadModuleFile | ( | StringRef | FileName | ) |
Definition at line 1262 of file CompilerInstance.cpp.
References getDiagnostics(), getFileManager(), clang::ASTReader::readASTFileControlBlock(), and clang::DiagnosticsEngine::Report().
Referenced by clang::FrontendAction::BeginSourceFile().
bool CompilerInstance::lookupMissingImports | ( | StringRef | Name, |
SourceLocation | TriggerLoc | ||
) | [override, virtual] |
Check global module index for missing imports.
Name | The symbol name to look for. |
TriggerLoc | The location for what triggered the load. |
Implements clang::ModuleLoader.
Definition at line 1666 of file CompilerInstance.cpp.
References clang::ModuleLoader::buildingModule(), loadGlobalModuleIndex(), and clang::GlobalModuleIndex::lookupIdentifier().
void CompilerInstance::makeModuleVisible | ( | Module * | Mod, |
Module::NameVisibilityKind | Visibility, | ||
SourceLocation | ImportLoc, | ||
bool | Complain | ||
) | [override, virtual] |
Make the given module visible.
Implements clang::ModuleLoader.
Definition at line 1601 of file CompilerInstance.cpp.
void clang::CompilerInstance::resetAndLeakASTContext | ( | ) | [inline] |
Definition at line 425 of file CompilerInstance.h.
References clang::BuryPointer().
Referenced by clang::FrontendAction::EndSourceFile().
void clang::CompilerInstance::resetAndLeakFileManager | ( | ) | [inline] |
Definition at line 366 of file CompilerInstance.h.
References clang::BuryPointer().
Referenced by clang::FrontendAction::EndSourceFile().
void clang::CompilerInstance::resetAndLeakPreprocessor | ( | ) | [inline] |
Definition at line 406 of file CompilerInstance.h.
References clang::BuryPointer().
Referenced by clang::FrontendAction::EndSourceFile().
void CompilerInstance::resetAndLeakSema | ( | ) |
Definition at line 1689 of file CompilerInstance.cpp.
References clang::BuryPointer(), and takeSema().
Referenced by clang::FrontendAction::EndSourceFile().
void clang::CompilerInstance::resetAndLeakSourceManager | ( | ) | [inline] |
Definition at line 386 of file CompilerInstance.h.
References clang::BuryPointer().
Referenced by clang::FrontendAction::EndSourceFile().
void CompilerInstance::setASTConsumer | ( | std::unique_ptr< ASTConsumer > | Value | ) |
setASTConsumer - Replace the current AST consumer; the compiler instance takes ownership of Value
.
Definition at line 104 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 98 of file CompilerInstance.cpp.
References Context.
Referenced by clang::FrontendAction::BeginSourceFile(), and clang::FrontendAction::EndSourceFile().
void clang::CompilerInstance::setBuildGlobalModuleIndex | ( | bool | Build | ) | [inline] |
Set the flag indicating whether we should (re)build the global module index.
Definition at line 220 of file CompilerInstance.h.
Referenced by compileModuleImpl().
void CompilerInstance::setCodeCompletionConsumer | ( | CodeCompleteConsumer * | Value | ) |
setCodeCompletionConsumer - Replace the current code completion consumer; the compiler instance takes ownership of Value
.
Definition at line 108 of file CompilerInstance.cpp.
Referenced by createCodeCompletionConsumer().
void CompilerInstance::setDiagnostics | ( | DiagnosticsEngine * | Value | ) |
setDiagnostics - Replace the current diagnostics engine.
Definition at line 76 of file CompilerInstance.cpp.
void CompilerInstance::setFileManager | ( | FileManager * | Value | ) |
Replace the current file manager and virtual file system.
Definition at line 84 of file CompilerInstance.cpp.
References clang::FileManager::getVirtualFileSystem().
Referenced by clang::FixItRecompile::BeginInvocation(), clang::FrontendAction::BeginSourceFile(), and clang::tooling::FrontendActionFactory::runInvocation().
void CompilerInstance::setInvocation | ( | CompilerInvocation * | Value | ) |
setInvocation - Replace the current invocation.
Definition at line 65 of file CompilerInstance.cpp.
Referenced by clang::tooling::FrontendActionFactory::runInvocation().
void CompilerInstance::setModuleDepCollector | ( | std::shared_ptr< ModuleDependencyCollector > | Collector | ) |
Definition at line 128 of file CompilerInstance.cpp.
void CompilerInstance::setModuleManager | ( | IntrusiveRefCntPtr< ASTReader > | Reader | ) |
Definition at line 119 of file CompilerInstance.cpp.
Referenced by clang::FrontendAction::BeginSourceFile().
void CompilerInstance::setPreprocessor | ( | Preprocessor * | Value | ) |
Replace the current preprocessor.
Definition at line 96 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 100 of file CompilerInstance.cpp.
Referenced by clang::FrontendAction::EndSourceFile().
void CompilerInstance::setSourceManager | ( | SourceManager * | Value | ) |
setSourceManager - Replace the current source manager.
Definition at line 92 of file CompilerInstance.cpp.
References SourceMgr.
Referenced by clang::FixItRecompile::BeginInvocation(), and clang::FrontendAction::BeginSourceFile().
void CompilerInstance::setTarget | ( | TargetInfo * | Value | ) |
Replace the current diagnostics engine.
Definition at line 80 of file CompilerInstance.cpp.
Referenced by ExecuteAction().
void clang::CompilerInstance::setVirtualFileSystem | ( | IntrusiveRefCntPtr< vfs::FileSystem > | FS | ) | [inline] |
Replace the current virtual file system.
Definition at line 350 of file CompilerInstance.h.
Referenced by clang::FrontendAction::BeginSourceFile(), and createFileManager().
Indicates whether we should (re)build the global module index.
Definition at line 69 of file CompilerInstance.cpp.
References clang::FrontendOptions::GenerateGlobalModuleIndex, and getFrontendOpts().
Referenced by clang::FrontendAction::Execute(), and loadGlobalModuleIndex().
std::unique_ptr<ASTConsumer> clang::CompilerInstance::takeASTConsumer | ( | ) | [inline] |
takeASTConsumer - Remove the current AST consumer and give ownership to the caller.
Definition at line 450 of file CompilerInstance.h.
Referenced by clang::FrontendAction::EndSourceFile().
std::unique_ptr< Sema > CompilerInstance::takeSema | ( | ) |
Definition at line 112 of file CompilerInstance.cpp.
Referenced by resetAndLeakSema().