clang API Documentation
Frontend action adaptor that merges ASTs together. More...
#include <FrontendActions.h>
Public Member Functions | |
ASTMergeAction (FrontendAction *AdaptedAction, ArrayRef< std::string > ASTFiles) | |
virtual | ~ASTMergeAction () |
bool | usesPreprocessorOnly () const override |
Does this action only use the preprocessor? | |
TranslationUnitKind | getTranslationUnitKind () override |
For AST-based actions, the kind of translation unit we're handling. | |
bool | hasPCHSupport () const override |
Does this action support use with PCH? | |
bool | hasASTFileSupport () const override |
Does this action support use with AST files? | |
bool | hasCodeCompletionSupport () const override |
Does this action support use with code completion? | |
Protected Member Functions | |
std::unique_ptr< ASTConsumer > | CreateASTConsumer (CompilerInstance &CI, StringRef InFile) override |
Create the AST consumer object for this action, if supported. | |
bool | BeginSourceFileAction (CompilerInstance &CI, StringRef Filename) override |
Callback at the start of processing a single input. | |
void | ExecuteAction () override |
Callback to run the program action, using the initialized compiler instance. | |
void | EndSourceFileAction () override |
Callback at the end of processing a single input. |
Frontend action adaptor that merges ASTs together.
This action takes an existing AST file and "merges" it into the AST context, producing a merged context. This action is an action adaptor, which forwards most of its calls to another action that will consume the merged context.
Definition at line 172 of file Frontend/FrontendActions.h.
ASTMergeAction::ASTMergeAction | ( | FrontendAction * | AdaptedAction, |
ArrayRef< std::string > | ASTFiles | ||
) |
Definition at line 79 of file ASTMerge.cpp.
ASTMergeAction::~ASTMergeAction | ( | ) | [virtual] |
Definition at line 85 of file ASTMerge.cpp.
bool ASTMergeAction::BeginSourceFileAction | ( | CompilerInstance & | CI, |
StringRef | Filename | ||
) | [override, protected, virtual] |
Callback at the start of processing a single input.
Reimplemented from clang::FrontendAction.
Definition at line 24 of file ASTMerge.cpp.
References clang::FrontendAction::BeginSourceFileAction(), clang::FrontendAction::getCurrentInput(), clang::FrontendAction::setCompilerInstance(), clang::FrontendAction::setCurrentInput(), and clang::FrontendAction::takeCurrentASTUnit().
std::unique_ptr< ASTConsumer > ASTMergeAction::CreateASTConsumer | ( | CompilerInstance & | CI, |
StringRef | InFile | ||
) | [override, protected, virtual] |
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.
CI | - The current compiler instance, provided as a convenience, see getCompilerInstance(). |
InFile | - The current input file, provided as a convenience, see getCurrentFile(). |
Implements clang::FrontendAction.
Definition at line 20 of file ASTMerge.cpp.
References clang::FrontendAction::CreateASTConsumer().
void ASTMergeAction::EndSourceFileAction | ( | ) | [override, protected, virtual] |
Callback at the end of processing a single input.
This is guaranteed to only be called following a successful call to BeginSourceFileAction (and BeginSourceFile).
Reimplemented from clang::FrontendAction.
Definition at line 75 of file ASTMerge.cpp.
References clang::FrontendAction::EndSourceFileAction().
void ASTMergeAction::ExecuteAction | ( | ) | [override, protected, virtual] |
Callback to run the program action, using the initialized compiler instance.
This is guaranteed to only be called between BeginSourceFileAction() and EndSourceFileAction().
Implements clang::FrontendAction.
Definition at line 34 of file ASTMerge.cpp.
References clang::DiagnosticConsumer::BeginSourceFile(), clang::DiagnosticConsumer::EndSourceFile(), clang::FrontendAction::ExecuteAction(), clang::FormatASTNodeDiagnosticArgument(), clang::TranslationUnitDecl::getASTContext(), clang::CompilerInstance::getASTContext(), clang::DiagnosticsEngine::getClient(), clang::FrontendAction::getCompilerInstance(), clang::DiagnosticsEngine::getDiagnosticIDs(), clang::CompilerInstance::getDiagnosticOpts(), clang::CompilerInstance::getDiagnostics(), clang::CompilerInstance::getFileManager(), clang::CompilerInstance::getFileSystemOpts(), clang::ASTContext::getLangOpts(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTUnit::LoadFromASTFile(), and clang::DiagnosticsEngine::SetArgToStringFn().
TranslationUnitKind ASTMergeAction::getTranslationUnitKind | ( | ) | [override, virtual] |
For AST-based actions, the kind of translation unit we're handling.
Reimplemented from clang::FrontendAction.
Definition at line 93 of file ASTMerge.cpp.
References clang::FrontendAction::getTranslationUnitKind().
bool ASTMergeAction::hasASTFileSupport | ( | ) | const [override, virtual] |
Does this action support use with AST files?
Reimplemented from clang::FrontendAction.
Definition at line 101 of file ASTMerge.cpp.
References clang::FrontendAction::hasASTFileSupport().
bool ASTMergeAction::hasCodeCompletionSupport | ( | ) | const [override, virtual] |
Does this action support use with code completion?
Reimplemented from clang::FrontendAction.
Definition at line 105 of file ASTMerge.cpp.
References clang::FrontendAction::hasCodeCompletionSupport().
bool ASTMergeAction::hasPCHSupport | ( | ) | const [override, virtual] |
Does this action support use with PCH?
Reimplemented from clang::FrontendAction.
Definition at line 97 of file ASTMerge.cpp.
References clang::FrontendAction::hasPCHSupport().
bool ASTMergeAction::usesPreprocessorOnly | ( | ) | const [override, virtual] |
Does this action only use the preprocessor?
If so no AST context will be created and this action will be invalid with AST file inputs.
Implements clang::FrontendAction.
Definition at line 89 of file ASTMerge.cpp.
References clang::FrontendAction::usesPreprocessorOnly().