File indexing completed on 2026-05-10 08:37:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_CLANG_TOOLING_ALLTUSEXECUTION_H
0015 #define LLVM_CLANG_TOOLING_ALLTUSEXECUTION_H
0016
0017 #include "clang/Tooling/ArgumentsAdjusters.h"
0018 #include "clang/Tooling/Execution.h"
0019 #include <optional>
0020
0021 namespace clang {
0022 namespace tooling {
0023
0024
0025
0026 class AllTUsToolExecutor : public ToolExecutor {
0027 public:
0028 static const char *ExecutorName;
0029
0030
0031
0032
0033 AllTUsToolExecutor(const CompilationDatabase &Compilations,
0034 unsigned ThreadCount,
0035 std::shared_ptr<PCHContainerOperations> PCHContainerOps =
0036 std::make_shared<PCHContainerOperations>());
0037
0038
0039
0040
0041
0042 AllTUsToolExecutor(CommonOptionsParser Options, unsigned ThreadCount,
0043 std::shared_ptr<PCHContainerOperations> PCHContainerOps =
0044 std::make_shared<PCHContainerOperations>());
0045
0046 StringRef getExecutorName() const override { return ExecutorName; }
0047
0048 using ToolExecutor::execute;
0049
0050 llvm::Error
0051 execute(llvm::ArrayRef<
0052 std::pair<std::unique_ptr<FrontendActionFactory>, ArgumentsAdjuster>>
0053 Actions) override;
0054
0055 ExecutionContext *getExecutionContext() override { return &Context; };
0056
0057 ToolResults *getToolResults() override { return Results.get(); }
0058
0059 void mapVirtualFile(StringRef FilePath, StringRef Content) override {
0060 OverlayFiles[FilePath] = std::string(Content);
0061 }
0062
0063 private:
0064
0065 std::optional<CommonOptionsParser> OptionsParser;
0066 const CompilationDatabase &Compilations;
0067 std::unique_ptr<ToolResults> Results;
0068 ExecutionContext Context;
0069 llvm::StringMap<std::string> OverlayFiles;
0070 unsigned ThreadCount;
0071 };
0072
0073 extern llvm::cl::opt<unsigned> ExecutorConcurrency;
0074 extern llvm::cl::opt<std::string> Filter;
0075
0076 }
0077 }
0078
0079 #endif