clang API Documentation
A frontend action which simply wraps some other runtime-specified frontend action. More...
#include <FrontendAction.h>
Public Member Functions | |
WrapperFrontendAction (FrontendAction *WrappedAction) | |
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 | hasIRSupport () const override |
Does this action support use with IR 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 | BeginInvocation (CompilerInstance &CI) override |
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvocation or do some other action before BeginSourceFileAction is called. | |
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. |
A frontend action which simply wraps some other runtime-specified frontend action.
Deriving from this class allows an action to inject custom logic around some existing action's behavior. It implements every virtual method in the FrontendAction interface by forwarding to the wrapped action.
Definition at line 272 of file FrontendAction.h.
WrapperFrontendAction::WrapperFrontendAction | ( | FrontendAction * | WrappedAction | ) |
Construct a WrapperFrontendAction from an existing action, taking ownership of it.
Definition at line 578 of file FrontendAction.cpp.
bool WrapperFrontendAction::BeginInvocation | ( | CompilerInstance & | CI | ) | [override, protected, virtual] |
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvocation or do some other action before BeginSourceFileAction is called.
Reimplemented from clang::FrontendAction.
Reimplemented in clang::arcmt::ObjCMigrateAction, clang::FixItRecompile, clang::arcmt::MigrateAction, clang::arcmt::ModifyAction, and clang::arcmt::CheckAction.
Definition at line 543 of file FrontendAction.cpp.
bool WrapperFrontendAction::BeginSourceFileAction | ( | CompilerInstance & | CI, |
StringRef | Filename | ||
) | [override, protected, virtual] |
Callback at the start of processing a single input.
Reimplemented from clang::FrontendAction.
Definition at line 546 of file FrontendAction.cpp.
References clang::FrontendAction::getCurrentInput().
std::unique_ptr< ASTConsumer > WrapperFrontendAction::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.
Reimplemented in clang::arcmt::ObjCMigrateAction.
Definition at line 539 of file FrontendAction.cpp.
Referenced by clang::arcmt::ObjCMigrateAction::CreateASTConsumer().
void WrapperFrontendAction::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 555 of file FrontendAction.cpp.
void WrapperFrontendAction::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 552 of file FrontendAction.cpp.
TranslationUnitKind WrapperFrontendAction::getTranslationUnitKind | ( | ) | [override, virtual] |
For AST-based actions, the kind of translation unit we're handling.
Reimplemented from clang::FrontendAction.
Definition at line 562 of file FrontendAction.cpp.
bool WrapperFrontendAction::hasASTFileSupport | ( | ) | const [override, virtual] |
Does this action support use with AST files?
Reimplemented from clang::FrontendAction.
Definition at line 568 of file FrontendAction.cpp.
bool WrapperFrontendAction::hasCodeCompletionSupport | ( | ) | const [override, virtual] |
Does this action support use with code completion?
Reimplemented from clang::FrontendAction.
Definition at line 574 of file FrontendAction.cpp.
bool WrapperFrontendAction::hasIRSupport | ( | ) | const [override, virtual] |
Does this action support use with IR files?
Reimplemented from clang::FrontendAction.
Definition at line 571 of file FrontendAction.cpp.
bool WrapperFrontendAction::hasPCHSupport | ( | ) | const [override, virtual] |
Does this action support use with PCH?
Reimplemented from clang::FrontendAction.
Definition at line 565 of file FrontendAction.cpp.
bool WrapperFrontendAction::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 559 of file FrontendAction.cpp.