clang API Documentation

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

A frontend action which simply wraps some other runtime-specified frontend action. More...

#include <FrontendAction.h>

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

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

Construct a WrapperFrontendAction from an existing action, taking ownership of it.

Definition at line 578 of file FrontendAction.cpp.


Member Function Documentation

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.

Returns:
True on success; on failure BeginSourceFileAction(), ExecuteAction() and EndSourceFileAction() will not be 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.

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

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.

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.

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.

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.

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.


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