]> granicus.if.org Git - clang/commitdiff
Move #include manipulation code to new lib/Tooling/Inclusions.
authorEric Liu <ioeric@google.com>
Fri, 18 May 2018 14:16:37 +0000 (14:16 +0000)
committerEric Liu <ioeric@google.com>
Fri, 18 May 2018 14:16:37 +0000 (14:16 +0000)
Summary:
clangToolingCore is linked into almost everything (incl. clang), but
not few tools need #include manipulation at this point. So pull this into a
separate library in Tooling.

Reviewers: ilya-biryukov

Subscribers: klimek, mgorny, cfe-commits, thakis

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332720 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Format/Format.h
include/clang/Tooling/Inclusions/HeaderIncludes.h [moved from include/clang/Tooling/Core/HeaderIncludes.h with 96% similarity]
include/clang/Tooling/Inclusions/IncludeStyle.h [moved from include/clang/Tooling/Core/IncludeStyle.h with 96% similarity]
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Tooling/CMakeLists.txt
lib/Tooling/Core/CMakeLists.txt
lib/Tooling/Inclusions/CMakeLists.txt [new file with mode: 0644]
lib/Tooling/Inclusions/HeaderIncludes.cpp [moved from lib/Tooling/Core/HeaderIncludes.cpp with 99% similarity]
lib/Tooling/Inclusions/IncludeStyle.cpp [moved from lib/Tooling/Core/IncludeStyle.cpp with 95% similarity]
unittests/Tooling/HeaderIncludesTest.cpp

index b4d99f07545a23f7028123237dbdee0563ba7b6f..75654875414f4f29a87048b79f0e64ab917af92d 100644 (file)
@@ -16,8 +16,8 @@
 #define LLVM_CLANG_FORMAT_FORMAT_H
 
 #include "clang/Basic/LangOptions.h"
-#include "clang/Tooling/Core/IncludeStyle.h"
 #include "clang/Tooling/Core/Replacement.h"
+#include "clang/Tooling/Inclusions/IncludeStyle.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/Regex.h"
 #include <system_error>
similarity index 96%
rename from include/clang/Tooling/Core/HeaderIncludes.h
rename to include/clang/Tooling/Inclusions/HeaderIncludes.h
index 1aaa3de441f6f41a03c5864981920b440f5ee5be..d99a3283168ce450572bed037f73de100e9f6d45 100644 (file)
@@ -7,12 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLING_CORE_HEADERINCLUDES_H
-#define LLVM_CLANG_TOOLING_CORE_HEADERINCLUDES_H
+#ifndef LLVM_CLANG_TOOLING_INCLUSIONS_HEADERINCLUDES_H
+#define LLVM_CLANG_TOOLING_INCLUSIONS_HEADERINCLUDES_H
 
 #include "clang/Basic/SourceManager.h"
 #include "clang/Tooling/Core/Replacement.h"
-#include "clang/Tooling/Core/IncludeStyle.h"
+#include "clang/Tooling/Inclusions/IncludeStyle.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Regex.h"
 #include <unordered_map>
@@ -134,4 +134,4 @@ private:
 } // namespace tooling
 } // namespace clang
 
-#endif // LLVM_CLANG_TOOLING_CORE_HEADERINCLUDES_H
+#endif // LLVM_CLANG_TOOLING_INCLUSIONS_HEADERINCLUDES_H
similarity index 96%
rename from include/clang/Tooling/Core/IncludeStyle.h
rename to include/clang/Tooling/Inclusions/IncludeStyle.h
index ed7bd08ce0c5c3160d84a8b283115649db193072..42d6e1a5cf160758f8712068faef82aeb442a11b 100644 (file)
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLING_CORE_INCLUDESTYLE_H
-#define LLVM_CLANG_TOOLING_CORE_INCLUDESTYLE_H
+#ifndef LLVM_CLANG_TOOLING_INCLUSIONS_INCLUDESTYLE_H
+#define LLVM_CLANG_TOOLING_INCLUSIONS_INCLUDESTYLE_H
 
 #include "llvm/Support/YAMLTraits.h"
 #include <string>
@@ -130,4 +130,4 @@ struct ScalarEnumerationTraits<
 } // namespace yaml
 } // namespace llvm
 
-#endif // LLVM_CLANG_TOOLING_CORE_INCLUDESTYLE_H
+#endif // LLVM_CLANG_TOOLING_INCLUSIONS_INCLUDESTYLE_H
index 42e6d53d9fe6ea55adc4425a5abf53b4092be096..0019d045cd06d72818feb9f4f5f49714b5a29dea 100644 (file)
@@ -20,4 +20,5 @@ add_clang_library(clangFormat
   clangBasic
   clangLex
   clangToolingCore
+  clangToolingInclusions
   )
index c6de92b3cafe93d6cd2a9afe15ff8df90d3c6472..d1a5dc8e6c692c9caf8bb3e449b532c004778b29 100644 (file)
@@ -31,7 +31,7 @@
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/VirtualFileSystem.h"
 #include "clang/Lex/Lexer.h"
-#include "clang/Tooling/Core/HeaderIncludes.h"
+#include "clang/Tooling/Inclusions/HeaderIncludes.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Allocator.h"
index eaae49b431fbe32a27ea148eeafb4c26fb1cac05..031d8b51dec46f21502b633dbb579c3f4150ebf2 100644 (file)
@@ -4,6 +4,7 @@ set(LLVM_LINK_COMPONENTS
   )
 
 add_subdirectory(Core)
+add_subdirectory(Inclusions)
 add_subdirectory(Refactoring)
 add_subdirectory(ASTDiff)
 
index 84d17984b429b66ed203eaf988e8239bcd6b5242..f7f423c5222851b2764462de2222de758ad6b30d 100644 (file)
@@ -2,8 +2,6 @@ set(LLVM_LINK_COMPONENTS support)
 
 add_clang_library(clangToolingCore
   Diagnostic.cpp
-  HeaderIncludes.cpp
-  IncludeStyle.cpp
   Lookup.cpp
   Replacement.cpp
 
diff --git a/lib/Tooling/Inclusions/CMakeLists.txt b/lib/Tooling/Inclusions/CMakeLists.txt
new file mode 100644 (file)
index 0000000..00afb50
--- /dev/null
@@ -0,0 +1,12 @@
+set(LLVM_LINK_COMPONENTS support)
+
+add_clang_library(clangToolingInclusions
+  HeaderIncludes.cpp
+  IncludeStyle.cpp
+
+  LINK_LIBS
+  clangBasic
+  clangLex
+  clangRewrite
+  clangToolingCore
+  )
similarity index 99%
rename from lib/Tooling/Core/HeaderIncludes.cpp
rename to lib/Tooling/Inclusions/HeaderIncludes.cpp
index d974d16f01c0c1d4428f579bcc418b08ab84eb9b..99c0866a6855554106a5f2cb80a581a6423b19ea 100644 (file)
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang/Tooling/Core/HeaderIncludes.h"
+#include "clang/Tooling/Inclusions/HeaderIncludes.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Lex/Lexer.h"
 
similarity index 95%
rename from lib/Tooling/Core/IncludeStyle.cpp
rename to lib/Tooling/Inclusions/IncludeStyle.cpp
index 74eec481c2884ec05e1377d322652e9bb4d4bf61..3597710f1f6e5f80a89264f82a8b85c374759a10 100644 (file)
@@ -7,8 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang/Tooling/Core/IncludeStyle.h"
-
+#include "clang/Tooling/Inclusions/IncludeStyle.h"
 
 using clang::tooling::IncludeStyle;
 
index 4407221f8ad75f3eb8ad0a1787df222cd4e76296..ff68f75a6e82bed86772f60581d8af8ac8425f62 100644 (file)
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang/Tooling/Core/HeaderIncludes.h"
+#include "clang/Tooling/Inclusions/HeaderIncludes.h"
 #include "../Tooling/ReplacementTest.h"
 #include "../Tooling/RewriterTestContext.h"
 #include "clang/Format/Format.h"