class ASTMergeAction
Declaration
class ASTMergeAction : public FrontendAction { /* full declaration omitted */ };
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.
Declared at: clang/include/clang/Frontend/FrontendActions.h:237
Inherits from: FrontendAction
Member Variables
- private std::unique_ptr<FrontendAction> AdaptedAction
- The action that the merge action adapts.
- private std::vector<std::string> ASTFiles
- The set of AST files to merge.
Method Overview
- public ASTMergeAction(std::unique_ptr<FrontendAction> AdaptedAction, ArrayRef<std::string> ASTFiles)
- protected bool BeginSourceFileAction(clang::CompilerInstance & CI)
- protected std::unique_ptr<ASTConsumer> CreateASTConsumer(clang::CompilerInstance & CI, llvm::StringRef InFile)
- protected void EndSourceFileAction()
- protected void ExecuteAction()
- public clang::TranslationUnitKind getTranslationUnitKind()
- public bool hasASTFileSupport() const
- public bool hasCodeCompletionSupport() const
- public bool hasPCHSupport() const
- public bool usesPreprocessorOnly() const
- public ~ASTMergeAction()
Inherited from FrontendAction:
- protected BeginInvocation
- public BeginSourceFile
- protected BeginSourceFileAction
- protected CreateASTConsumer
- public EndSourceFile
- protected EndSourceFileAction
- public Execute
- protected ExecuteAction
- public PrepareToExecute
- protected PrepareToExecuteAction
- public getCompilerInstance
- public getCurrentASTUnit
- public getCurrentFile
- public getCurrentFileKind
- public getCurrentFileOrBufferName
- public getCurrentInput
- public getCurrentModule
- public getTranslationUnitKind
- public hasASTFileSupport
- public hasCodeCompletionSupport
- public hasIRSupport
- public hasPCHSupport
- public isCurrentFileAST
- public isModelParsingAction
- public setCompilerInstance
- public setCurrentInput
- protected shouldEraseOutputFiles
- public takeCurrentASTUnit
- public usesPreprocessorOnly
Methods
¶ASTMergeAction(
std::unique_ptr<FrontendAction> AdaptedAction,
ArrayRef<std::string> ASTFiles)
ASTMergeAction(
std::unique_ptr<FrontendAction> AdaptedAction,
ArrayRef<std::string> ASTFiles)
Declared at: clang/include/clang/Frontend/FrontendActions.h:254
Parameters
- std::unique_ptr<FrontendAction> AdaptedAction
- ArrayRef<std::string> ASTFiles
¶bool BeginSourceFileAction(
clang::CompilerInstance& CI)
bool BeginSourceFileAction(
clang::CompilerInstance& CI)
Description
Callback at the start of processing a single input.
Declared at: clang/include/clang/Frontend/FrontendActions.h:248
Parameters
Returns
True on success; on failure ExecutionAction() and EndSourceFileAction() will not be called.
¶std::unique_ptr<ASTConsumer> CreateASTConsumer(
clang::CompilerInstance& CI,
llvm::StringRef InFile)
std::unique_ptr<ASTConsumer> CreateASTConsumer(
clang::CompilerInstance& CI,
llvm::StringRef InFile)
Description
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.
Declared at: clang/include/clang/Frontend/FrontendActions.h:245
Parameters
- clang::CompilerInstance& CI
- - The current compiler instance, provided as a convenience, see getCompilerInstance().
- llvm::StringRef InFile
- - The current input file, provided as a convenience, see getCurrentFile().
Returns
The new AST consumer, or null on failure.
¶void EndSourceFileAction()
void EndSourceFileAction()
Description
Callback at the end of processing a single input. This is guaranteed to only be called following a successful call to BeginSourceFileAction (and BeginSourceFile).
Declared at: clang/include/clang/Frontend/FrontendActions.h:251
¶void ExecuteAction()
void ExecuteAction()
Description
Callback to run the program action, using the initialized compiler instance. This is guaranteed to only be called between BeginSourceFileAction() and EndSourceFileAction().
Declared at: clang/include/clang/Frontend/FrontendActions.h:250
¶clang::TranslationUnitKind
getTranslationUnitKind()
clang::TranslationUnitKind
getTranslationUnitKind()
Description
For AST-based actions, the kind of translation unit we're handling.
Declared at: clang/include/clang/Frontend/FrontendActions.h:259
¶bool hasASTFileSupport() const
bool hasASTFileSupport() const
Description
Does this action support use with AST files?
Declared at: clang/include/clang/Frontend/FrontendActions.h:261
¶bool hasCodeCompletionSupport() const
bool hasCodeCompletionSupport() const
Description
Does this action support use with code completion?
Declared at: clang/include/clang/Frontend/FrontendActions.h:262
¶bool hasPCHSupport() const
bool hasPCHSupport() const
Description
Does this action support use with PCH?
Declared at: clang/include/clang/Frontend/FrontendActions.h:260
¶bool usesPreprocessorOnly() const
bool usesPreprocessorOnly() const
Description
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.
Declared at: clang/include/clang/Frontend/FrontendActions.h:258
¶~ASTMergeAction()
~ASTMergeAction()
Declared at: clang/include/clang/Frontend/FrontendActions.h:256