Commit Graph

6 Commits

Author SHA1 Message Date
Sam McCall 2e2d5d03cb [Tooling] Use UniqueStringSaver. NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337682 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 11:25:25 +00:00
Haojian Wu 1ab87cac0c [Tooling] Optimize memory usage in InMemoryToolResults.
Avoid storing duplicated "std::string"s.

clangd's global-symbol-builder takes 20+GB memory running across LLVM
repository. With this patch, the used memory is ~10GB (running on 48
threads, most of meory are AST-related).

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D45479

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329784 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-11 08:13:07 +00:00
Eric Liu 1f874ca3c3 Add a tool executor that runs actions on all TUs in the compilation database.
Summary: Tool results are deduplicated by the result key.

Reviewers: hokein

Subscribers: klimek, mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D41729

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321864 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 10:32:16 +00:00
Eric Liu 5e73ee6e4f [Tooling] Fix linking of StandaloneToolExecutorPlugin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317332 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-03 15:57:27 +00:00
Eric Liu 26d6ffeb22 [Tooling] Put createExecutorFromCommandLineArgs implementation in a wrapper. NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317328 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-03 15:20:57 +00:00
Eric Liu e7a10639e3 [Tooling] A new framework for executing clang frontend actions.
Summary:
This defines a `clang::tooling::ToolExecutor` interface that can be extended to support different execution plans including standalone execution on a given set of TUs or parallel execution on all TUs in a codebase.

In order to enable multiprocessing execution, tool actions are expected to output result into a `ToolResults` interface provided by executors. The `ToolResults` interface abstracts how results are stored e.g. in-memory for standalone executions or on-disk for large-scale execution.

New executors can be registered as `ToolExecutorPlugin`s via the `ToolExecutorPluginRegistry`. CLI tools can use `createExecutorFromCommandLineArgs` to create a specific registered executor according to the command-line arguments.

This patch also implements `StandaloneToolExecutor` which has the same behavior as the current `ClangTool` interface, i.e. execute frontend actions on a given set of TUs. At this point, it's simply a wrapper around `ClangTool` at this point.

This is still experimental but expected to replace the existing `ClangTool` interface so that specific tools would not need to worry about execution.

Reviewers: klimek, arphaman, hokein, sammccall

Reviewed By: klimek

Subscribers: cfe-commits, djasper, mgorny, omtcyfz

Differential Revision: https://reviews.llvm.org/D34272

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316653 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-26 10:38:14 +00:00