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 ()
virtual bool usesPreprocessorOnly () const
virtual TranslationUnitKind getTranslationUnitKind ()
 For AST-based actions, the kind of translation unit we're handling.
virtual bool hasPCHSupport () const
 hasPCHSupport - Does this action support use with PCH?
virtual bool hasASTFileSupport () const
 hasASTFileSupport - Does this action support use with AST files?
virtual bool hasCodeCompletionSupport () const

Protected Member Functions

virtual ASTConsumerCreateASTConsumer (CompilerInstance &CI, StringRef InFile)
virtual bool BeginSourceFileAction (CompilerInstance &CI, StringRef Filename)
virtual void ExecuteAction ()
virtual void EndSourceFileAction ()

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 138 of file Frontend/FrontendActions.h.


Constructor & Destructor Documentation

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

Definition at line 81 of file ASTMerge.cpp.

ASTMergeAction::~ASTMergeAction ( ) [virtual]

Definition at line 87 of file ASTMerge.cpp.


Member Function Documentation

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

BeginSourceFileAction - Callback at the start of processing a single input.

Returns:
True on success; on failure
See also:
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().

ASTConsumer * ASTMergeAction::CreateASTConsumer ( CompilerInstance CI,
StringRef  InFile 
) [protected, virtual]

CreateASTConsumer - Create the AST consumer object for this action, if supported.

This routine is called as part of

See also:
BeginSourceAction(), 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 also:
getCompilerInstance().
Parameters:
InFile- The current input file, provided as a convenience,
See also:
getCurrentFile().
Returns:
The new AST consumer, or 0 on failure.

Implements clang::FrontendAction.

Definition at line 19 of file ASTMerge.cpp.

References clang::FrontendAction::CreateASTConsumer().

void ASTMergeAction::EndSourceFileAction ( ) [protected, virtual]

EndSourceFileAction - 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 77 of file ASTMerge.cpp.

References clang::FrontendAction::EndSourceFileAction().

void ASTMergeAction::ExecuteAction ( ) [protected, virtual]
TranslationUnitKind ASTMergeAction::getTranslationUnitKind ( ) [virtual]

For AST-based actions, the kind of translation unit we're handling.

Reimplemented from clang::FrontendAction.

Definition at line 95 of file ASTMerge.cpp.

References clang::FrontendAction::getTranslationUnitKind().

bool ASTMergeAction::hasASTFileSupport ( ) const [virtual]

hasASTFileSupport - Does this action support use with AST files?

Reimplemented from clang::FrontendAction.

Definition at line 103 of file ASTMerge.cpp.

References clang::FrontendAction::hasASTFileSupport().

bool ASTMergeAction::hasCodeCompletionSupport ( ) const [virtual]

hasCodeCompletionSupport - Does this action support use with code completion?

Reimplemented from clang::FrontendAction.

Definition at line 107 of file ASTMerge.cpp.

References clang::FrontendAction::hasCodeCompletionSupport().

bool ASTMergeAction::hasPCHSupport ( ) const [virtual]

hasPCHSupport - Does this action support use with PCH?

Reimplemented from clang::FrontendAction.

Definition at line 99 of file ASTMerge.cpp.

References clang::FrontendAction::hasPCHSupport().

bool ASTMergeAction::usesPreprocessorOnly ( ) const [virtual]

usesPreprocessorOnly - 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 91 of file ASTMerge.cpp.

References clang::FrontendAction::usesPreprocessorOnly().


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