class AllTUsToolExecutor
Declaration
class AllTUsToolExecutor : public ToolExecutor { /* full declaration omitted */ };
Description
Executes given frontend actions on all files/TUs in the compilation database.
Declared at: clang/include/clang/Tooling/AllTUsExecution.h:25
Inherits from: ToolExecutor
Member Variables
- private llvm::Optional<CommonOptionsParser> OptionsParser
- private const clang::tooling::CompilationDatabase& Compilations
- private std::unique_ptr<ToolResults> Results
- private clang::tooling::ExecutionContext Context
- private llvm::StringMap<std::string> OverlayFiles
- private unsigned int ThreadCount
- public static const char* ExecutorName
Method Overview
- public AllTUsToolExecutor(const clang::tooling::CompilationDatabase & Compilations, unsigned int ThreadCount, std::shared_ptr<PCHContainerOperations> PCHContainerOps = std::make_shared<clang::PCHContainerOperations>())
- public AllTUsToolExecutor(clang::tooling::CommonOptionsParser Options, unsigned int ThreadCount, std::shared_ptr<PCHContainerOperations> PCHContainerOps = std::make_shared<clang::PCHContainerOperations>())
- public llvm::Error execute(llvm::ArrayRef<std::pair<std::unique_ptr<FrontendActionFactory>, ArgumentsAdjuster>> Actions)
- public clang::tooling::ExecutionContext * getExecutionContext()
- public llvm::StringRef getExecutorName() const
- public clang::tooling::ToolResults * getToolResults()
- public void mapVirtualFile(llvm::StringRef FilePath, llvm::StringRef Content)
Inherited from ToolExecutor:
- public execute
- public execute
- public execute
- public getExecutionContext
- public getExecutorName
- public getToolResults
- public mapVirtualFile
Methods
¶AllTUsToolExecutor(
const clang::tooling::CompilationDatabase&
Compilations,
unsigned int ThreadCount,
std::shared_ptr<PCHContainerOperations>
PCHContainerOps = std::make_shared<
clang::PCHContainerOperations>())
AllTUsToolExecutor(
const clang::tooling::CompilationDatabase&
Compilations,
unsigned int ThreadCount,
std::shared_ptr<PCHContainerOperations>
PCHContainerOps = std::make_shared<
clang::PCHContainerOperations>())
Description
Init with \p CompilationDatabase. This uses \p ThreadCount threads to exececute the actions on all files in parallel. If \p ThreadCount is 0, this uses `llvm::hardware_concurrency`.
Declared at: clang/include/clang/Tooling/AllTUsExecution.h:32
Parameters
- const clang::tooling::CompilationDatabase& Compilations
- unsigned int ThreadCount
- std::shared_ptr<PCHContainerOperations> PCHContainerOps = std::make_shared<clang::PCHContainerOperations>()
¶AllTUsToolExecutor(
clang::tooling::CommonOptionsParser Options,
unsigned int ThreadCount,
std::shared_ptr<PCHContainerOperations>
PCHContainerOps = std::make_shared<
clang::PCHContainerOperations>())
AllTUsToolExecutor(
clang::tooling::CommonOptionsParser Options,
unsigned int ThreadCount,
std::shared_ptr<PCHContainerOperations>
PCHContainerOps = std::make_shared<
clang::PCHContainerOperations>())
Description
Init with \p CommonOptionsParser. This is expected to be used by `createExecutorFromCommandLineArgs` based on commandline options. The executor takes ownership of \p Options.
Declared at: clang/include/clang/Tooling/AllTUsExecution.h:41
Parameters
- clang::tooling::CommonOptionsParser Options
- unsigned int ThreadCount
- std::shared_ptr<PCHContainerOperations> PCHContainerOps = std::make_shared<clang::PCHContainerOperations>()
¶llvm::Error execute(
llvm::ArrayRef<std::pair<
std::unique_ptr<FrontendActionFactory>,
ArgumentsAdjuster>> Actions)
llvm::Error execute(
llvm::ArrayRef<std::pair<
std::unique_ptr<FrontendActionFactory>,
ArgumentsAdjuster>> Actions)
Description
Executes each action with a corresponding arguments adjuster.
Declared at: clang/include/clang/Tooling/AllTUsExecution.h:50
Parameters
- llvm::ArrayRef<std::pair< std::unique_ptr<FrontendActionFactory>, ArgumentsAdjuster>> Actions
¶clang::tooling::ExecutionContext*
getExecutionContext()
clang::tooling::ExecutionContext*
getExecutionContext()
Description
Returns a reference to the execution context. This should be passed to tool callbacks, and tool callbacks should report results via the returned context.
Declared at: clang/include/clang/Tooling/AllTUsExecution.h:54
¶llvm::StringRef getExecutorName() const
llvm::StringRef getExecutorName() const
Description
Returns the name of a specific executor.
Declared at: clang/include/clang/Tooling/AllTUsExecution.h:45
¶clang::tooling::ToolResults* getToolResults()
clang::tooling::ToolResults* getToolResults()
Description
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.
Declared at: clang/include/clang/Tooling/AllTUsExecution.h:56
¶void mapVirtualFile(llvm::StringRef FilePath,
llvm::StringRef Content)
void mapVirtualFile(llvm::StringRef FilePath,
llvm::StringRef Content)
Description
Map a virtual file to be used while running the tool.
Declared at: clang/include/clang/Tooling/AllTUsExecution.h:58
Parameters
- llvm::StringRef FilePath
- The path at which the content will be mapped.
- llvm::StringRef Content
- A buffer of the file's content.