]> granicus.if.org Git - clang/commitdiff
Fix a big layering violation introduced by r158771.
authorChandler Carruth <chandlerc@gmail.com>
Wed, 20 Jun 2012 09:53:52 +0000 (09:53 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 20 Jun 2012 09:53:52 +0000 (09:53 +0000)
That commit added a new library just to hold the RawCommentList. I've
started a discussion on the commit thread about whether that is really
meritted -- it certainly doesn't seem necessary at this stage.

However, the immediate problem is that the AST library has a hard
dependency on the Comment library, but the dependencies were set up
completely backward. In addition to the layering violation, this had an
unfortunate effect if scattering the Comments library dependency
throughout the build system, but inconsistently so -- several parts of
the CMake dependencies were missing and only showed up due to transitive
deps or the fact that the target wasn't being built by tho bots.

It turns out that the Comments library can't (currently) be a well
formed layer *below* the AST library either, as it has an API that
accepts an ASTContext. That parameter is currently unused, so maybe that
was a mistake?

Anyways, it really seems like this is logically part of the AST --
that's the whole point of the ASTContext providing access to it as far
as I can tell -- so I've merged it into the AST library to solve the
immediate layering violation problems and remove some of the churn from
our library dependencies.

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

19 files changed:
include/clang/AST/ASTContext.h
include/clang/AST/RawCommentList.h [moved from include/clang/Comments/RawCommentList.h with 100% similarity]
lib/AST/CMakeLists.txt
lib/AST/RawCommentList.cpp [moved from lib/Comments/RawCommentList.cpp with 99% similarity]
lib/CMakeLists.txt
lib/Comments/CMakeLists.txt [deleted file]
lib/Comments/Makefile [deleted file]
lib/Makefile
lib/Sema/CMakeLists.txt
tools/arcmt-test/Makefile
tools/c-index-test/Makefile
tools/clang-check/CMakeLists.txt
tools/clang-check/Makefile
tools/diagtool/Makefile
tools/driver/Makefile
tools/libclang/CMakeLists.txt
tools/libclang/Makefile
unittests/Frontend/Makefile
unittests/Tooling/Makefile

index 172ac88edf459555abc6d71d78b0df8cf2b254ee..cc2d98736f79da168b643b1bf2d775f5679d8ebd 100644 (file)
@@ -27,7 +27,7 @@
 #include "clang/AST/TemplateName.h"
 #include "clang/AST/Type.h"
 #include "clang/AST/CanonicalType.h"
-#include "clang/Comments/RawCommentList.h"
+#include "clang/AST/RawCommentList.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
index 716459a930cf6086bde6cb9aa3c9bac12c762de7..67809446650eeb3ac87bff65c76a5e489b83a454 100644 (file)
@@ -35,6 +35,7 @@ add_clang_library(clangAST
   NestedNameSpecifier.cpp
   NSAPI.cpp
   ParentMap.cpp
+  RawCommentList.cpp
   RecordLayout.cpp
   RecordLayoutBuilder.cpp
   SelectorLocationsKind.cpp
similarity index 99%
rename from lib/Comments/RawCommentList.cpp
rename to lib/AST/RawCommentList.cpp
index 7db9175c174a500331996e5de7bf2027e0903564..07776779e87059c2471ecb3d30e2e77071a416fb 100644 (file)
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang/Comments/RawCommentList.h"
+#include "clang/AST/RawCommentList.h"
 #include "clang/AST/ASTContext.h"
 #include "llvm/ADT/STLExtras.h"
 
index 228b43b23592ac9f9eea14afa42a713550a6f2bb..dfb9d61ff5391160aa908ba5da162ea18ee2c2c3 100644 (file)
@@ -15,4 +15,3 @@ add_subdirectory(Frontend)
 add_subdirectory(FrontendTool)
 add_subdirectory(Tooling)
 add_subdirectory(StaticAnalyzer)
-add_subdirectory(Comments)
diff --git a/lib/Comments/CMakeLists.txt b/lib/Comments/CMakeLists.txt
deleted file mode 100644 (file)
index db4ca73..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-set(LLVM_USED_LIBS clangBasic clangAST clangLex)
-
-add_clang_library(clangComments
-  RawCommentList.cpp
-  )
-
diff --git a/lib/Comments/Makefile b/lib/Comments/Makefile
deleted file mode 100644 (file)
index 0783f1f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- clang/lib/Comments/Makefile -------------------------*- Makefile -*-===##
-# 
-#                     The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-# 
-##===----------------------------------------------------------------------===##
-
-CLANG_LEVEL := ../..
-LIBRARYNAME := clangComments
-
-include $(CLANG_LEVEL)/Makefile
-
index 0e81af19cee04269d570f07c47e33a465482957c..2eb72a91e68b9b32f0e5bef91e9da67309325562 100755 (executable)
@@ -10,7 +10,7 @@ CLANG_LEVEL := ..
 
 PARALLEL_DIRS = Headers Basic Lex Parse AST Sema CodeGen Analysis \
                 StaticAnalyzer Edit Rewrite ARCMigrate Serialization Frontend \
-                FrontendTool Tooling Driver Comments
+                FrontendTool Tooling Driver
 
 include $(CLANG_LEVEL)/Makefile
 
index 3a898dde23fecb2e682c82a7899519f38945edf9..07734c7c7b571bb0202743d52af761177988a4f7 100644 (file)
@@ -4,7 +4,6 @@ set(LLVM_USED_LIBS
   clangBasic
   clangEdit
   clangLex
-  clangComments
   )
 
 add_clang_library(clangSema
index 81f27c2b11df408b4e78c90d8d90d67142a56085..84c4dc2b665420b4d5ec174ef3b81a33b472bfff 100644 (file)
@@ -19,7 +19,7 @@ NO_INSTALL = 1
 LINK_COMPONENTS := support mc
 USEDLIBS = clangARCMigrate.a clangRewrite.a \
                 clangFrontend.a clangDriver.a clangSerialization.a clangParse.a \
-                clangSema.a clangEdit.a clangAnalysis.a clangAST.a clangLex.a clangComments.a \
+                clangSema.a clangEdit.a clangAnalysis.a clangAST.a clangLex.a \
                 clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
index b061492cafe9b3ab517095ab9970a638dc7ad1bd..35f2c040c6d2bfd2637ac27207eb5fd7d87ca750 100644 (file)
@@ -20,7 +20,7 @@ TOOL_NO_EXPORTS = 1
 LINK_COMPONENTS := support mc
 USEDLIBS = clang.a clangFrontend.a clangDriver.a \
           clangSerialization.a clangParse.a clangSema.a \
-          clangAnalysis.a clangEdit.a clangAST.a clangLex.a clangComments.a \
+          clangAnalysis.a clangEdit.a clangAST.a clangLex.a \
           clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
index 83fe10f80ee4b97887a20dfbf20c6471c8e22440..851d6cdd1615c62fe13bb2467aa055af95aaa1f5 100644 (file)
@@ -1,4 +1,4 @@
-set(LLVM_USED_LIBS clangTooling clangBasic clangComments)
+set(LLVM_USED_LIBS clangTooling clangBasic)
 
 add_clang_executable(clang-check
   ClangCheck.cpp
index 5c54a6b33214418f74f05733863db5c3f1ca5140..49b1ada95b93819f884f9bffcf26aa6ce9c69bfe 100644 (file)
@@ -18,7 +18,7 @@ TOOL_NO_EXPORTS = 1
 LINK_COMPONENTS := support mc
 USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a \
            clangTooling.a clangParse.a clangSema.a clangAnalysis.a \
-           clangEdit.a clangAST.a clangLex.a clangComments.a clangBasic.a
+           clangEdit.a clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
 
index 5f5fb2ae365ae9a8989a941a39570bd0385643ed..8af4cef6433cecb9c150e8088c040ebb50ebc02e 100644 (file)
@@ -20,7 +20,7 @@ LINK_COMPONENTS := support mc
 
 USEDLIBS = clangFrontend.a clangDriver.a clangSerialization.a clangParse.a \
            clangSema.a clangAnalysis.a clangEdit.a clangAST.a clangLex.a \
-           clangComments.a clangBasic.a
+           clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
 
index 4105cb6d94f10f6459b047c4c36c20bcd591b50e..270d4fdda863b0bd54135bf879e18519fb87af91 100644 (file)
@@ -36,7 +36,7 @@ USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \
            clangStaticAnalyzerFrontend.a clangStaticAnalyzerCheckers.a \
            clangStaticAnalyzerCore.a \
            clangAnalysis.a clangARCMigrate.a clangRewrite.a \
-           clangEdit.a clangAST.a clangLex.a clangComments.a clangBasic.a
+           clangEdit.a clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
 
index 7a6732a77a53a52f147d350a762113bf222bab62..293dfa3ff94d675973b0c67111aabfb9d9a55eb9 100644 (file)
@@ -6,7 +6,6 @@ set(LLVM_USED_LIBS
   clangSerialization
   clangSema
   clangEdit
-  clangComments
   clangAST
   clangLex
   clangBasic)
index 78da0675dc36c93185e6b39c77b58ce0e4d1b447..8d0a614403added8c852cdcf8e3d60fc502f920e 100644 (file)
@@ -19,7 +19,7 @@ LINK_COMPONENTS := support mc
 USEDLIBS = clangARCMigrate.a clangRewrite.a clangFrontend.a clangDriver.a \
      clangSerialization.a \
                 clangParse.a clangSema.a clangEdit.a clangAnalysis.a \
-                clangAST.a clangLex.a clangComments.a clangBasic.a
+                clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
 
index 357e24234fc3e05e586eca5805a2eac455380e01..f3e639665849185d7a7e5715736c156086182d6b 100644 (file)
@@ -14,6 +14,6 @@ USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \
            clangSerialization.a clangCodeGen.a clangParse.a clangSema.a \
            clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
            clangARCMigrate.a clangRewrite.a clangEdit.a \
-           clangAnalysis.a clangAST.a clangLex.a clangComments.a clangBasic.a
+           clangAnalysis.a clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/unittests/Makefile
index 84e05bb0e469127121d183f9b9646c155551db55..5d6747dce803b883cee87fffb0a7755c6d1f73dd 100644 (file)
@@ -12,6 +12,6 @@ TESTNAME = Tooling
 LINK_COMPONENTS := support mc
 USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
            clangParse.a clangRewrite.a clangSema.a clangAnalysis.a clangEdit.a \
-           clangAST.a clangLex.a clangComments.a clangBasic.a
+           clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/unittests/Makefile