[clang] d1f13c5 - [clang][Tooling] Move STL recognizer to its own library

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 6 01:09:25 PDT 2022


Author: Kadir Cetinkaya
Date: 2022-10-06T10:09:13+02:00
New Revision: d1f13c54f172875d9a14c46c09afb1f22d78cdf8

URL: https://github.com/llvm/llvm-project/commit/d1f13c54f172875d9a14c46c09afb1f22d78cdf8
DIFF: https://github.com/llvm/llvm-project/commit/d1f13c54f172875d9a14c46c09afb1f22d78cdf8.diff

LOG: [clang][Tooling] Move STL recognizer to its own library

As pointed out in https://reviews.llvm.org/D119130#3829816, this
introduces a clang AST dependency to the clangToolingInclusions, which is used
by clang-format.

Since rest of the inclusion tooling doesn't depend on clang ast, moving this
into a separate library.

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

Added: 
    clang/lib/Tooling/Inclusions/Stdlib/CMakeLists.txt
    clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp

Modified: 
    clang-tools-extra/clangd/CMakeLists.txt
    clang/lib/Tooling/Inclusions/CMakeLists.txt
    clang/unittests/Tooling/CMakeLists.txt

Removed: 
    clang/lib/Tooling/Inclusions/StandardLibrary.cpp


################################################################################
diff  --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt
index de8f087a52a5e..56ff54f8fadde 100644
--- a/clang-tools-extra/clangd/CMakeLists.txt
+++ b/clang-tools-extra/clangd/CMakeLists.txt
@@ -160,6 +160,7 @@ clang_target_link_libraries(clangDaemon
   clangTooling
   clangToolingCore
   clangToolingInclusions
+  clangToolingInclusionsStdlib
   clangToolingSyntax
   )
 

diff  --git a/clang/lib/Tooling/Inclusions/CMakeLists.txt b/clang/lib/Tooling/Inclusions/CMakeLists.txt
index fba003b4e0de5..1954d16a1b231 100644
--- a/clang/lib/Tooling/Inclusions/CMakeLists.txt
+++ b/clang/lib/Tooling/Inclusions/CMakeLists.txt
@@ -3,12 +3,12 @@ set(LLVM_LINK_COMPONENTS support)
 add_clang_library(clangToolingInclusions
   HeaderIncludes.cpp
   IncludeStyle.cpp
-  StandardLibrary.cpp
 
   LINK_LIBS
-  clangAST
   clangBasic
   clangLex
   clangRewrite
   clangToolingCore
   )
+
+  add_subdirectory(Stdlib)

diff  --git a/clang/lib/Tooling/Inclusions/Stdlib/CMakeLists.txt b/clang/lib/Tooling/Inclusions/Stdlib/CMakeLists.txt
new file mode 100644
index 0000000000000..0f52c3590ac9a
--- /dev/null
+++ b/clang/lib/Tooling/Inclusions/Stdlib/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_clang_library(clangToolingInclusionsStdlib
+  StandardLibrary.cpp
+
+  LINK_LIBS
+  clangAST
+  )

diff  --git a/clang/lib/Tooling/Inclusions/StandardLibrary.cpp b/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp
similarity index 100%
rename from clang/lib/Tooling/Inclusions/StandardLibrary.cpp
rename to clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp

diff  --git a/clang/unittests/Tooling/CMakeLists.txt b/clang/unittests/Tooling/CMakeLists.txt
index dfc1f59cf0a83..424932e529519 100644
--- a/clang/unittests/Tooling/CMakeLists.txt
+++ b/clang/unittests/Tooling/CMakeLists.txt
@@ -81,6 +81,7 @@ clang_target_link_libraries(ToolingTests
   clangTooling
   clangToolingCore
   clangToolingInclusions
+  clangToolingInclusionsStdlib
   clangToolingRefactoring
   clangTransformer
   )


        


More information about the cfe-commits mailing list