Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c92dae6

Browse files
committed
[clang][deps] Remove dependency on llvm targets from lib DependencyScanning (llvm#129774)
In d64eccf we split the object file reader from the writer and removed the dependency on clangCodeGen from the dependency scanner. However, we were still initializing all the llvm targets, which was needed for writing object file pcms but not reading them. This caused us to link more llvm target code than necessary. Shrinks clangd by nearly 50% for me. rdar://144790713 (cherry picked from commit f8ba0df) (cherry picked from commit c0eb45d)
1 parent 875dbc4 commit c92dae6

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

clang/lib/Tooling/DependencyScanning/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
set(LLVM_LINK_COMPONENTS
2-
${LLVM_TARGETS_TO_BUILD}
32
Core
43
Option
54
Support

clang/lib/Tooling/DependencyScanning/DependencyScanningService.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "llvm/CAS/ActionCache.h"
1111
#include "llvm/CAS/CachingOnDiskFileSystem.h"
1212
#include "llvm/CAS/ObjectStore.h"
13-
#include "llvm/Support/TargetSelect.h"
1413

1514
using namespace clang;
1615
using namespace tooling;
@@ -27,10 +26,4 @@ DependencyScanningService::DependencyScanningService(
2726
SharedFS(std::move(SharedFS)) {
2827
if (!this->SharedFS)
2928
SharedCache.emplace();
30-
31-
// Initialize targets for object file support.
32-
llvm::InitializeAllTargets();
33-
llvm::InitializeAllTargetMCs();
34-
llvm::InitializeAllAsmPrinters();
35-
llvm::InitializeAllAsmParsers();
3629
}

0 commit comments

Comments
 (0)