clang API Documentation
#include <FrontendActions.h>
Protected Member Functions | |
void | ExecuteAction () override |
Callback to run the program action, using the initialized compiler instance. | |
std::unique_ptr< ASTConsumer > | CreateASTConsumer (CompilerInstance &, StringRef) override |
Create the AST consumer object for this action, if supported. | |
bool | usesPreprocessorOnly () const override |
Does this action only use the preprocessor? |
Definition at line 200 of file Frontend/FrontendActions.h.
std::unique_ptr<ASTConsumer> clang::PrintPreambleAction::CreateASTConsumer | ( | CompilerInstance & | CI, |
StringRef | InFile | ||
) | [inline, 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.
Definition at line 203 of file Frontend/FrontendActions.h.
void PrintPreambleAction::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 663 of file Frontend/FrontendActions.cpp.
References clang::Lexer::ComputePreamble(), clang::FileManager::getBufferForFile(), clang::FrontendAction::getCompilerInstance(), clang::FrontendAction::getCurrentFile(), clang::FrontendAction::getCurrentFileKind(), clang::CompilerInstance::getFileManager(), clang::CompilerInstance::getLangOpts(), clang::IK_Asm, clang::IK_AST, clang::IK_C, clang::IK_CUDA, clang::IK_CXX, clang::IK_LLVM_IR, clang::IK_None, clang::IK_ObjC, clang::IK_ObjCXX, clang::IK_OpenCL, clang::IK_PreprocessedC, clang::IK_PreprocessedCXX, clang::IK_PreprocessedObjC, and clang::IK_PreprocessedObjCXX.
bool clang::PrintPreambleAction::usesPreprocessorOnly | ( | ) | const [inline, override, protected, 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 208 of file Frontend/FrontendActions.h.