Index: include/clang/Tooling/AllTUsExecution.h =================================================================== --- include/clang/Tooling/AllTUsExecution.h +++ include/clang/Tooling/AllTUsExecution.h @@ -45,6 +45,8 @@ StringRef getExecutorName() const override { return ExecutorName; } + bool isSingleProcess() const override { return true; } + using ToolExecutor::execute; llvm::Error Index: include/clang/Tooling/Execution.h =================================================================== --- include/clang/Tooling/Execution.h +++ include/clang/Tooling/Execution.h @@ -114,6 +114,13 @@ /// Returns the name of a specific executor. virtual StringRef getExecutorName() const = 0; + /// Should return true iff executor runs all actions in a single process. + /// Clients can use this signal to find out if they can collect results + /// in-memory (e.g. to avoid serialization costs of using ToolResults). + /// The single-process executors can still run multiple threads, but all + /// executions are guaranteed to share the same memory. + virtual bool isSingleProcess() const = 0; + /// Executes each action with a corresponding arguments adjuster. virtual llvm::Error execute(llvm::ArrayRef< Index: include/clang/Tooling/StandaloneExecution.h =================================================================== --- include/clang/Tooling/StandaloneExecution.h +++ include/clang/Tooling/StandaloneExecution.h @@ -52,6 +52,8 @@ StringRef getExecutorName() const override { return ExecutorName; } + bool isSingleProcess() const override { return true; } + using ToolExecutor::execute; llvm::Error Index: unittests/Tooling/ExecutionTest.cpp =================================================================== --- unittests/Tooling/ExecutionTest.cpp +++ unittests/Tooling/ExecutionTest.cpp @@ -96,6 +96,8 @@ StringRef getExecutorName() const override { return ExecutorName; } + bool isSingleProcess() const override { return true; } + llvm::Error execute(llvm::ArrayRef, ArgumentsAdjuster>>) override {