9#ifndef LLVM_CLANG_FRONTEND_FRONTENDACTIONS_H
10#define LLVM_CLANG_FRONTEND_FRONTENDACTIONS_H
24 void ExecuteAction()
override;
27 StringRef InFile)
override;
37 void ExecuteAction()
override;
40 StringRef InFile)
override;
48 StringRef InFile)
override {
52 void ExecuteAction()
override;
65 StringRef InFile)
override;
71 StringRef InFile)
override;
77 StringRef InFile)
override;
83 StringRef InFile)
override;
89 StringRef InFile)
override;
105 std::string &Sysroot);
109 static std::unique_ptr<llvm::raw_pwrite_stream>
111 std::string &OutputFile);
117 virtual std::unique_ptr<raw_pwrite_stream>
122 StringRef InFile)
override;
136 StringRef InFile)
override;
146 std::unique_ptr<raw_pwrite_stream>
154 std::unique_ptr<raw_pwrite_stream>
163 std::unique_ptr<raw_pwrite_stream>
170 StringRef InFile)
override;
181 std::shared_ptr<llvm::raw_ostream> OutputStream;
185 StringRef InFile)
override;
192 : OutputStream(Out) {}
202 StringRef InFile)
override;
213 StringRef InFile)
override;
228 std::unique_ptr<FrontendAction> AdaptedAction;
231 std::vector<std::string> ASTFiles;
235 StringRef InFile)
override;
258 StringRef)
override {
269 StringRef)
override {
303 StringRef ModuleName;
304 void ExecuteAction()
override;
308 : ModuleName(ModuleName) {}
Defines the clang::FrontendAction interface and various convenience abstract classes (clang::ASTFront...
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
Abstract base class to use for AST consumer-based frontend actions.
Frontend action adaptor that merges ASTs together.
bool hasCodeCompletionSupport() const override
Does this action support use with code completion?
void EndSourceFileAction() override
Callback at the end of processing a single input.
TranslationUnitKind getTranslationUnitKind() override
For AST-based actions, the kind of translation unit we're handling.
~ASTMergeAction() override
bool usesPreprocessorOnly() const override
Does this action only use the preprocessor?
bool hasASTFileSupport() const override
Does this action support use with AST files?
void ExecuteAction() override
Callback to run the program action, using the initialized compiler instance.
bool BeginSourceFileAction(CompilerInstance &CI) override
Callback at the start of processing a single input.
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
bool hasPCHSupport() const override
Does this action support use with PCH?
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
bool usesPreprocessorOnly() const override
Does this action only use the preprocessor?
Dump information about the given module file, to be used for basic debugging and discovery.
DumpModuleInfoAction()=default
DumpModuleInfoAction(std::shared_ptr< llvm::raw_ostream > Out)
bool hasCodeCompletionSupport() const override
Does this action support use with code completion?
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 hasPCHSupport() const override
Does this action support use with PCH?
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
void ExecuteAction() override
Implement the ExecuteAction interface by running Sema on the already-initialized AST consumer.
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
void ExecuteAction() override
Callback to run the program action, using the initialized compiler instance.
void ExecuteAction() override
Callback to run the program action, using the initialized compiler instance.
Abstract base class for actions which can be performed by the frontend.
friend class ASTMergeAction
TranslationUnitKind getTranslationUnitKind() override
For AST-based actions, the kind of translation unit we're handling.
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
bool hasASTFileSupport() const override
Does this action support use with AST files?
bool shouldEraseOutputFiles() override
Callback at the end of processing a single input, to determine if the output files should be erased o...
TranslationUnitKind getTranslationUnitKind() override
For AST-based actions, the kind of translation unit we're handling.
bool hasASTFileSupport() const override
Does this action support use with AST files?
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
static std::unique_ptr< llvm::raw_pwrite_stream > CreateOutputFile(CompilerInstance &CI, StringRef InFile, std::string &OutputFile)
Creates file to write the PCH into and returns a stream to write it into.
bool BeginSourceFileAction(CompilerInstance &CI) override
Callback at the start of processing a single input.
TranslationUnitKind getTranslationUnitKind() override
For AST-based actions, the kind of translation unit we're handling.
static bool ComputeASTConsumerArguments(CompilerInstance &CI, std::string &Sysroot)
Compute the AST consumer arguments that will be used to create the PCHGenerator instance returned by ...
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
bool hasASTFileSupport() const override
Does this action support use with AST files?
bool shouldEraseOutputFiles() override
Callback at the end of processing a single input, to determine if the output files should be erased o...
GetDependenciesByModuleNameAction(StringRef ModuleName)
bool usesPreprocessorOnly() const override
Does this action only use the preprocessor?
void ExecuteAction() override
Callback to run the program action, using the initialized compiler instance.
Abstract base class to use for preprocessor-based frontend actions.
bool usesPreprocessorOnly() const override
Does this action only use the preprocessor?
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &, StringRef) override
Create the AST consumer object for this action, if supported.
void ExecuteAction() override
Callback to run the program action, using the initialized compiler instance.
bool usesPreprocessorOnly() const override
Does this action only use the preprocessor?
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.
void ExecuteAction() override
Callback to run the program action, using the initialized compiler instance.
bool hasPCHSupport() const override
Does this action support use with PCH?
Preprocessor-based frontend action that also loads PCH files.
bool usesPreprocessorOnly() const override
Does this action only use the preprocessor?
~SyntaxOnlyAction() override
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
bool hasCodeCompletionSupport() const override
Does this action support use with code completion?
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
void ExecuteAction() override
Implement the ExecuteAction interface by running Sema on the already-initialized AST consumer.
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
bool hasCodeCompletionSupport() const override
Does this action support use with code completion?
void ExecuteAction() override
Implement the ExecuteAction interface by running Sema on the already-initialized AST consumer.
TranslationUnitKind
Describes the kind of translation unit being processed.
@ TU_Module
The translation unit is a module.
@ TU_Prefix
The translation unit is a prefix to a translation unit, and is not complete.