clang 20.0.0git
|
Executes given frontend actions on all files/TUs in the compilation database. More...
#include "clang/Tooling/AllTUsExecution.h"
Public Member Functions | |
AllTUsToolExecutor (const CompilationDatabase &Compilations, unsigned ThreadCount, std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >()) | |
Init with CompilationDatabase . | |
AllTUsToolExecutor (CommonOptionsParser Options, unsigned ThreadCount, std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >()) | |
Init with CommonOptionsParser . | |
StringRef | getExecutorName () const override |
Returns the name of a specific executor. | |
llvm::Error | execute (llvm::ArrayRef< std::pair< std::unique_ptr< FrontendActionFactory >, ArgumentsAdjuster > > Actions) override |
Executes each action with a corresponding arguments adjuster. | |
ExecutionContext * | getExecutionContext () override |
Returns a reference to the execution context. | |
ToolResults * | getToolResults () override |
Returns a reference to the result container. | |
void | mapVirtualFile (StringRef FilePath, StringRef Content) override |
Map a virtual file to be used while running the tool. | |
virtual llvm::Error | execute (llvm::ArrayRef< std::pair< std::unique_ptr< FrontendActionFactory >, ArgumentsAdjuster > > Actions)=0 |
Executes each action with a corresponding arguments adjuster. | |
llvm::Error | execute (std::unique_ptr< FrontendActionFactory > Action) |
Convenient functions for the above execute . | |
llvm::Error | execute (std::unique_ptr< FrontendActionFactory > Action, ArgumentsAdjuster Adjuster) |
Executes an action with an argument adjuster. | |
Public Member Functions inherited from clang::tooling::ToolExecutor | |
virtual | ~ToolExecutor () |
virtual StringRef | getExecutorName () const =0 |
Returns the name of a specific executor. | |
virtual llvm::Error | execute (llvm::ArrayRef< std::pair< std::unique_ptr< FrontendActionFactory >, ArgumentsAdjuster > > Actions)=0 |
Executes each action with a corresponding arguments adjuster. | |
llvm::Error | execute (std::unique_ptr< FrontendActionFactory > Action) |
Convenient functions for the above execute . | |
llvm::Error | execute (std::unique_ptr< FrontendActionFactory > Action, ArgumentsAdjuster Adjuster) |
Executes an action with an argument adjuster. | |
virtual ExecutionContext * | getExecutionContext ()=0 |
Returns a reference to the execution context. | |
virtual ToolResults * | getToolResults ()=0 |
Returns a reference to the result container. | |
virtual void | mapVirtualFile (StringRef FilePath, StringRef Content)=0 |
Map a virtual file to be used while running the tool. | |
Static Public Attributes | |
static const char * | ExecutorName = "AllTUsToolExecutor" |
Executes given frontend actions on all files/TUs in the compilation database.
Definition at line 26 of file AllTUsExecution.h.
clang::tooling::AllTUsToolExecutor::AllTUsToolExecutor | ( | const CompilationDatabase & | Compilations, |
unsigned | ThreadCount, | ||
std::shared_ptr< PCHContainerOperations > | PCHContainerOps = std::make_shared<PCHContainerOperations>() |
||
) |
Init with CompilationDatabase
.
This uses ThreadCount
threads to exececute the actions on all files in parallel. If ThreadCount
is 0, this uses llvm::hardware_concurrency
.
Definition at line 64 of file AllTUsExecution.cpp.
clang::tooling::AllTUsToolExecutor::AllTUsToolExecutor | ( | CommonOptionsParser | Options, |
unsigned | ThreadCount, | ||
std::shared_ptr< PCHContainerOperations > | PCHContainerOps = std::make_shared<PCHContainerOperations>() |
||
) |
Init with CommonOptionsParser
.
This is expected to be used by createExecutorFromCommandLineArgs
based on commandline options.
The executor takes ownership of Options
.
Definition at line 70 of file AllTUsExecution.cpp.
|
overridevirtual |
Executes each action with a corresponding arguments adjuster.
Implements clang::tooling::ToolExecutor.
Definition at line 78 of file AllTUsExecution.cpp.
References clang::tooling::ClangTool::appendArgumentsAdjuster(), clang::File, clang::tooling::Filter, clang::tooling::CompilationDatabase::getAllFiles(), clang::tooling::getDefaultArgumentsAdjusters(), Log, clang::tooling::make_string_error(), and Path.
|
virtual |
Executes each action with a corresponding arguments adjuster.
Implements clang::tooling::ToolExecutor.
llvm::Error clang::tooling::ToolExecutor::execute | ( | std::unique_ptr< FrontendActionFactory > | Action | ) |
Convenient functions for the above execute
.
Definition at line 125 of file Execution.cpp.
llvm::Error clang::tooling::ToolExecutor::execute | ( | std::unique_ptr< FrontendActionFactory > | Action, |
ArgumentsAdjuster | Adjuster | ||
) |
Executes an action with an argument adjuster.
Definition at line 127 of file Execution.cpp.
|
inlineoverridevirtual |
Returns a reference to the execution context.
This should be passed to tool callbacks, and tool callbacks should report results via the returned context.
Implements clang::tooling::ToolExecutor.
Definition at line 55 of file AllTUsExecution.h.
|
inlineoverridevirtual |
Returns the name of a specific executor.
Implements clang::tooling::ToolExecutor.
Definition at line 46 of file AllTUsExecution.h.
References ExecutorName.
|
inlineoverridevirtual |
Returns a reference to the result container.
NOTE: This should only be used after the execution finishes. Tool callbacks should report results via ExecutionContext
instead.
Implements clang::tooling::ToolExecutor.
Definition at line 57 of file AllTUsExecution.h.
|
inlineoverridevirtual |
Map a virtual file to be used while running the tool.
FilePath | The path at which the content will be mapped. |
Content | A buffer of the file's content. |
Implements clang::tooling::ToolExecutor.
Definition at line 59 of file AllTUsExecution.h.
|
static |
Definition at line 28 of file AllTUsExecution.h.
Referenced by getExecutorName().