Abstract base class for actions which can be performed by the frontend. More...
#include "clang/Frontend/FrontendAction.h"
Abstract base class for actions which can be performed by the frontend.
Definition at line 37 of file FrontendAction.h.
◆ FrontendAction() ◆ ~FrontendAction() ◆ BeginInvocation() ◆ BeginSourceFile()Prepare the action for processing the input file Input
.
This is run after the options and frontend have been initialized, but prior to executing any per-file processing.
Definition at line 585 of file FrontendAction.cpp.
References clang::PreprocessorOptions::AllowPCHWithCompilerErrors, BeginInvocation(), clang::DiagnosticConsumer::BeginSourceFile(), BeginSourceFileAction(), clang::SrcMgr::C_System, clang::SrcMgr::C_User, clang::PreprocessorOptions::ChainedIncludes, clang::CompilerInstance::clearOutputFiles(), clang::LangOptionsBase::CMK_ModuleMap, clang::LangOptionsBase::CMK_None, clang::CompilerInstance::createASTContext(), clang::CompilerInstance::createASTReader(), clang::createChainedIncludesSource(), clang::SourceManager::createFileID(), clang::CompilerInstance::createFileManager(), clang::CompilerInstance::createPCHExternalASTSource(), clang::CompilerInstance::createPreprocessor(), clang::CompilerInstance::createSourceManager(), clang::LangOptions::CurrentModule, clang::PreprocessorOptions::DeserializedPCHDeclsToErrorOn, clang::PreprocessorOptions::DisablePCHOrModuleValidation, clang::PreprocessorOptions::DumpDeserializedPCHDecls, clang::DiagnosticConsumer::EndSourceFile(), clang::File, clang::FileName, Filename, clang::ModuleMap::finishModuleDeclarationScope(), clang::Found, clang::CompilerInstance::getASTContext(), clang::CompilerInstance::getASTReader(), clang::Preprocessor::getBuiltinInfo(), getCurrentFileOrBufferName(), clang::Preprocessor::getCurrentModuleImplementation(), clang::CompilerInstance::getDiagnosticClient(), clang::CompilerInstance::getDiagnosticOpts(), clang::CompilerInstance::getDiagnostics(), clang::ASTContext::getExternalSource(), clang::FrontendInputFile::getFile(), clang::CompilerInstance::getFileManager(), clang::CompilerInstance::getFileSystemOpts(), clang::InputKind::getFormat(), clang::CompilerInstance::getFrontendOpts(), clang::Preprocessor::getHeaderSearchInfo(), clang::CompilerInstance::getHeaderSearchOpts(), clang::CompilerInstance::getHeaderSearchOptsPtr(), clang::InputKind::getHeaderUnitKind(), clang::Preprocessor::getIdentifierTable(), getInputBufferForModule(), clang::FrontendInputFile::getKind(), clang::CompilerInstance::getLangOpts(), clang::Preprocessor::getLangOpts(), clang::CompilerInstance::getLangOptsPtr(), clang::InputKind::getLanguage(), clang::CompilerInstance::getModuleCache(), clang::ASTReader::getModuleManager(), clang::HeaderSearch::getModuleMap(), clang::FileEntryRef::getName(), clang::FileManager::getOptionalDirectoryRef(), clang::FileManager::getOptionalFileRef(), clang::CompilerInstance::getPCHContainerReader(), clang::CompilerInstance::getPreprocessor(), clang::CompilerInstance::getPreprocessorOpts(), clang::serialization::ModuleManager::getPrimaryModule(), clang::CompilerInstance::getSourceManager(), clang::CompilerInstance::getSpecificModuleCachePath(), clang::CompilerInstance::getTargetOpts(), getTranslationUnitKind(), clang::FileManager::getVirtualFileSystem(), clang::CompilerInstance::hasASTConsumer(), clang::CompilerInstance::hasASTContext(), hasASTFileSupport(), clang::CompilerInstance::hasFileManager(), hasIRSupport(), hasPCHSupport(), clang::CompilerInstance::hasPreprocessor(), clang::CompilerInstance::hasSourceManager(), clang::InputKind::HeaderUnit_Abs, clang::InputKind::HeaderUnit_System, clang::PreprocessorOptions::ImplicitPCHInclude, clang::Builtin::Context::initializeBuiltins(), clang::SourceManager::initializeForReplay(), clang::CompilerInstance::InitializeSourceManager(), clang::ASTReader::isAcceptableASTFile(), clang::FrontendInputFile::isEmpty(), clang::InputKind::isHeaderUnit(), isModelParsingAction(), clang::InputKind::isPreprocessed(), clang::FrontendInputFile::isPreprocessed(), clang::FrontendInputFile::isSystem(), clang::LLVM_IR, clang::ASTUnit::LoadEverything, clang::ASTUnit::LoadFromASTFile(), clang::CompilerInstance::loadModuleFile(), clang::HeaderSearch::loadModuleMapFile(), loadModuleMapForModuleBuild(), clang::ASTUnit::LoadPreprocessorOnly, clang::HeaderSearch::LookupFile(), clang::FrontendOptions::ModuleFiles, clang::InputKind::ModuleMap, clang::FrontendOptions::ModuleMapFiles, clang::LangOptions::ModuleName, clang::FrontendOptions::ModulesEmbedAllFiles, clang::FrontendOptions::ModulesEmbedFiles, clang::FrontendOptions::OverrideRecordLayoutsFile, clang::InputKind::Precompiled, prepareToBuildModule(), clang::Module::PresumedModuleMapFile, ReadOriginalFileName(), clang::DiagnosticsEngine::Report(), clang::DiagnosticOptions::SARIF, clang::SourceManager::setAllFilesAreTransient(), clang::CompilerInstance::setASTConsumer(), clang::CompilerInstance::setASTContext(), clang::ASTContext::setASTMutationListener(), clang::CompilerInstance::setASTReader(), setCompilerInstance(), setCurrentInput(), clang::ASTContext::setExternalSource(), clang::SourceManager::setFileIsTransient(), clang::CompilerInstance::setFileManager(), clang::CompilerInstance::setPreprocessor(), clang::Preprocessor::setSkipMainFilePreamble(), clang::CompilerInstance::setSourceManager(), clang::serialization::ModuleFile::StandardCXXModule, usesPreprocessorOnly(), clang::ASTReader::visitTopLevelModuleMaps(), and clang::InputKind::withHeaderUnit().
Referenced by clang::CompilerInstance::ExecuteAction(), and clang::ASTUnit::LoadFromCompilerInvocationAction().
◆ BeginSourceFileAction() ◆ CreateASTConsumer()Create the AST consumer object for this action, if supported.
This routine is called as part of BeginSourceFile(), which will fail if the AST consumer cannot be created. This will not be called if the action has indicated that it only uses the preprocessor.
Implemented in clang::PrintPreambleAction, clang::PrintDependencyDirectivesSourceMinimizerAction, clang::CodeGenAction, clang::ExtractAPIAction, clang::WrappingExtractAPIAction, clang::PreprocessorFrontendAction, clang::WrapperFrontendAction, clang::ASTPrintAction, clang::ASTDumpAction, clang::ASTDeclListAction, clang::ASTViewAction, clang::GeneratePCHAction, clang::GenerateModuleAction, clang::GenerateInterfaceStubsAction, clang::GenerateModuleInterfaceAction, clang::SyntaxOnlyAction, clang::DumpModuleInfoAction, clang::VerifyPCHAction, clang::TemplightDumpAction, clang::ASTMergeAction, clang::installapi::InstallAPIAction, clang::HTMLPrintAction, clang::FixItAction, clang::RewriteObjCAction, clang::ento::AnalysisAction, clang::ento::ParseModelFileAction, clang::IncrementalAction, and clang::PluginASTAction.
◆ EndSourceFile() void FrontendAction::EndSourceFile ( ) virtualPerform any per-file post processing, deallocate per-file objects, and run statistics and output file cleanup code.
Reimplemented in clang::WrapperFrontendAction, and clang::IncrementalAction.
Definition at line 1094 of file FrontendAction.cpp.
References clang::CompilerInstance::clearOutputFiles(), clang::LangOptionsBase::CMK_None, clang::FrontendOptions::DisableFree, clang::DiagnosticConsumer::EndSourceFile(), clang::Preprocessor::EndSourceFile(), EndSourceFileAction(), getCompilerInstance(), getCurrentFileOrBufferName(), clang::CompilerInstance::getDiagnosticClient(), clang::CompilerInstance::getFrontendOpts(), clang::Preprocessor::getHeaderSearchInfo(), clang::Preprocessor::getIdentifierTable(), clang::CompilerInstance::getLangOpts(), clang::CompilerInstance::getPreprocessor(), clang::CompilerInstance::getSourceManager(), clang::CompilerInstance::hasPreprocessor(), isCurrentFileAST(), clang::HeaderSearch::PrintStats(), clang::Preprocessor::PrintStats(), clang::IdentifierTable::PrintStats(), clang::SourceManager::PrintStats(), clang::CompilerInstance::resetAndLeakASTContext(), clang::CompilerInstance::resetAndLeakFileManager(), clang::CompilerInstance::resetAndLeakPreprocessor(), clang::CompilerInstance::resetAndLeakSema(), clang::CompilerInstance::resetAndLeakSourceManager(), clang::CompilerInstance::setASTConsumer(), clang::CompilerInstance::setASTContext(), setCompilerInstance(), setCurrentInput(), clang::CompilerInstance::setFileManager(), clang::CompilerInstance::setPreprocessor(), clang::CompilerInstance::setSema(), clang::CompilerInstance::setSourceManager(), shouldEraseOutputFiles(), clang::FrontendOptions::ShowStats, and clang::CompilerInstance::takeASTConsumer().
Referenced by clang::CompilerInstance::ExecuteAction(), and clang::ASTUnit::LoadFromCompilerInvocationAction().
◆ EndSourceFileAction() virtual void clang::FrontendAction::EndSourceFileAction ( ) inlineprotectedvirtual ◆ Execute() llvm::Error FrontendAction::Execute ( )Set the source manager's main input file, and run the action.
Definition at line 1070 of file FrontendAction.cpp.
References ExecuteAction(), getCompilerInstance(), clang::CompilerInstance::getFileManager(), clang::Preprocessor::getHeaderSearchInfo(), clang::HeaderSearch::getModuleCachePath(), clang::CompilerInstance::getPCHContainerReader(), clang::CompilerInstance::getPreprocessor(), clang::CompilerInstance::hasFileManager(), clang::CompilerInstance::hasPreprocessor(), clang::CompilerInstance::shouldBuildGlobalModuleIndex(), and clang::GlobalModuleIndex::writeIndex().
Referenced by clang::CompilerInstance::ExecuteAction(), and clang::ASTUnit::LoadFromCompilerInvocationAction().
◆ ExecuteAction() virtual void clang::FrontendAction::ExecuteAction ( ) protectedpure virtualCallback to run the program action, using the initialized compiler instance.
This is guaranteed to only be called between BeginSourceFileAction() and EndSourceFileAction().
Implemented in clang::CodeGenAction, clang::ASTFrontendAction, clang::WrapperFrontendAction, clang::DumpModuleInfoAction, clang::VerifyPCHAction, clang::TemplightDumpAction, clang::ASTMergeAction, clang::PrintPreambleAction, clang::PrintDependencyDirectivesSourceMinimizerAction, clang::DumpRawTokensAction, clang::DumpTokensAction, clang::PreprocessOnlyAction, clang::PrintPreprocessedAction, clang::RewriteMacrosAction, clang::RewriteTestAction, clang::RewriteIncludesAction, clang::IncrementalSyntaxOnlyAction, and clang::IncrementalAction.
Referenced by Execute(), and clang::IncrementalSyntaxOnlyAction::ExecuteAction().
◆ getCompilerInstance()Definition at line 120 of file FrontendAction.h.
Referenced by clang::FixItAction::BeginSourceFileAction(), EndSourceFile(), clang::CodeGenAction::EndSourceFileAction(), Execute(), clang::CodeGenAction::ExecuteAction(), clang::ASTFrontendAction::ExecuteAction(), clang::DumpModuleInfoAction::ExecuteAction(), clang::VerifyPCHAction::ExecuteAction(), clang::TemplightDumpAction::ExecuteAction(), clang::ASTMergeAction::ExecuteAction(), clang::PrintPreambleAction::ExecuteAction(), clang::PrintDependencyDirectivesSourceMinimizerAction::ExecuteAction(), clang::DumpRawTokensAction::ExecuteAction(), clang::DumpTokensAction::ExecuteAction(), clang::PreprocessOnlyAction::ExecuteAction(), clang::PrintPreprocessedAction::ExecuteAction(), clang::RewriteMacrosAction::ExecuteAction(), clang::RewriteTestAction::ExecuteAction(), clang::RewriteIncludesAction::ExecuteAction(), clang::IncrementalSyntaxOnlyAction::ExecuteAction(), clang::IncrementalAction::ExecuteAction(), getCurrentModule(), shouldEraseOutputFiles(), clang::GeneratePCHAction::shouldEraseOutputFiles(), and clang::GenerateModuleAction::shouldEraseOutputFiles().
◆ getCurrentASTUnit() ASTUnit & clang::FrontendAction::getCurrentASTUnit ( ) const inline ◆ getCurrentFile() StringRef clang::FrontendAction::getCurrentFile ( ) const inline ◆ getCurrentFileKind() InputKind clang::FrontendAction::getCurrentFileKind ( ) const inline ◆ getCurrentFileOrBufferName() StringRef clang::FrontendAction::getCurrentFileOrBufferName ( ) const inline ◆ getCurrentInput() ◆ getCurrentModule() Module * FrontendAction::getCurrentModule ( ) const ◆ getTranslationUnitKind() ◆ hasASTFileSupport() virtual bool clang::FrontendAction::hasASTFileSupport ( ) const inlinevirtual ◆ hasCodeCompletionSupport() virtual bool clang::FrontendAction::hasCodeCompletionSupport ( ) const inlinevirtual ◆ hasIRSupport() virtual bool clang::FrontendAction::hasIRSupport ( ) const inlinevirtual ◆ hasPCHSupport() virtual bool clang::FrontendAction::hasPCHSupport ( ) const inlinevirtual ◆ isCurrentFileAST() bool clang::FrontendAction::isCurrentFileAST ( ) const inline ◆ isModelParsingAction() virtual bool clang::FrontendAction::isModelParsingAction ( ) const inlinevirtual ◆ PrepareToExecute() ◆ PrepareToExecuteAction() ◆ setCompilerInstance() ◆ setCurrentInput() void FrontendAction::setCurrentInput ( const FrontendInputFile & CurrentInput, std::unique_ptr< ASTUnit > AST =nullptr
) ◆ shouldEraseOutputFiles() bool FrontendAction::shouldEraseOutputFiles ( ) protectedvirtual ◆ takeCurrentASTUnit() std::unique_ptr< ASTUnit > clang::FrontendAction::takeCurrentASTUnit ( ) inline ◆ usesPreprocessorOnly() virtual bool clang::FrontendAction::usesPreprocessorOnly ( ) const pure virtual ◆ ASTMergeAction ◆ WrapperFrontendAction
The documentation for this class was generated from the following files:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4