clang API Documentation

Public Member Functions | Protected Member Functions
clang::ASTMergeAction Class Reference

Frontend action adaptor that merges ASTs together. More...

#include <FrontendActions.h>

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

List of all members.

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< ASTConsumerCreateASTConsumer (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.

Detailed Description

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.


Constructor & Destructor Documentation

ASTMergeAction::ASTMergeAction ( FrontendAction AdaptedAction,
ArrayRef< std::string >  ASTFiles 
)

Definition at line 79 of file ASTMerge.cpp.

Definition at line 85 of file ASTMerge.cpp.


Member Function Documentation

bool ASTMergeAction::BeginSourceFileAction ( CompilerInstance CI,
StringRef  Filename 
) [override, protected, virtual]

Callback at the start of processing a single input.

Returns:
True on success; on failure ExecutionAction() and EndSourceFileAction() will not be called.

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.

Parameters:
CI- The current compiler instance, provided as a convenience, see getCompilerInstance().
InFile- The current input file, provided as a convenience, see getCurrentFile().
Returns:
The new AST consumer, or null on failure.

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]

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


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