Fix a big layering violation introduced by r158771.

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
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 172ac88..cc2d987 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -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"
diff --git a/include/clang/Comments/RawCommentList.h b/include/clang/AST/RawCommentList.h
similarity index 100%
rename from include/clang/Comments/RawCommentList.h
rename to include/clang/AST/RawCommentList.h
diff --git a/lib/AST/CMakeLists.txt b/lib/AST/CMakeLists.txt
index 716459a..6780944 100644
--- a/lib/AST/CMakeLists.txt
+++ b/lib/AST/CMakeLists.txt
@@ -35,6 +35,7 @@
   NestedNameSpecifier.cpp
   NSAPI.cpp
   ParentMap.cpp
+  RawCommentList.cpp
   RecordLayout.cpp
   RecordLayoutBuilder.cpp
   SelectorLocationsKind.cpp
diff --git a/lib/Comments/RawCommentList.cpp b/lib/AST/RawCommentList.cpp
similarity index 98%
rename from lib/Comments/RawCommentList.cpp
rename to lib/AST/RawCommentList.cpp
index 7db9175..0777677 100644
--- a/lib/Comments/RawCommentList.cpp
+++ b/lib/AST/RawCommentList.cpp
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang/Comments/RawCommentList.h"
+#include "clang/AST/RawCommentList.h"
 #include "clang/AST/ASTContext.h"
 #include "llvm/ADT/STLExtras.h"
 
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 228b43b..dfb9d61 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -15,4 +15,3 @@
 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
index db4ca73..0000000
--- a/lib/Comments/CMakeLists.txt
+++ /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
index 0783f1f..0000000
--- a/lib/Comments/Makefile
+++ /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
-
diff --git a/lib/Makefile b/lib/Makefile
index 0e81af1..2eb72a9 100755
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -10,7 +10,7 @@
 
 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
 
diff --git a/lib/Sema/CMakeLists.txt b/lib/Sema/CMakeLists.txt
index 3a898dd..07734c7 100644
--- a/lib/Sema/CMakeLists.txt
+++ b/lib/Sema/CMakeLists.txt
@@ -4,7 +4,6 @@
   clangBasic
   clangEdit
   clangLex
-  clangComments
   )
 
 add_clang_library(clangSema
diff --git a/tools/arcmt-test/Makefile b/tools/arcmt-test/Makefile
index 81f27c2..84c4dc2 100644
--- a/tools/arcmt-test/Makefile
+++ b/tools/arcmt-test/Makefile
@@ -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 \
+		 clangSema.a clangEdit.a clangAnalysis.a clangAST.a clangLex.a \
 		 clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
diff --git a/tools/c-index-test/Makefile b/tools/c-index-test/Makefile
index b061492..35f2c04 100644
--- a/tools/c-index-test/Makefile
+++ b/tools/c-index-test/Makefile
@@ -20,7 +20,7 @@
 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
diff --git a/tools/clang-check/CMakeLists.txt b/tools/clang-check/CMakeLists.txt
index 83fe10f..851d6cd 100644
--- a/tools/clang-check/CMakeLists.txt
+++ b/tools/clang-check/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(LLVM_USED_LIBS clangTooling clangBasic clangComments)
+set(LLVM_USED_LIBS clangTooling clangBasic)
 
 add_clang_executable(clang-check
   ClangCheck.cpp
diff --git a/tools/clang-check/Makefile b/tools/clang-check/Makefile
index 5c54a6b..49b1ada 100644
--- a/tools/clang-check/Makefile
+++ b/tools/clang-check/Makefile
@@ -18,7 +18,7 @@
 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
 
diff --git a/tools/diagtool/Makefile b/tools/diagtool/Makefile
index 5f5fb2a..8af4cef 100644
--- a/tools/diagtool/Makefile
+++ b/tools/diagtool/Makefile
@@ -20,7 +20,7 @@
 
 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
 
diff --git a/tools/driver/Makefile b/tools/driver/Makefile
index 4105cb6..270d4fd 100644
--- a/tools/driver/Makefile
+++ b/tools/driver/Makefile
@@ -36,7 +36,7 @@
            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
 
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
index 7a6732a..293dfa3 100644
--- a/tools/libclang/CMakeLists.txt
+++ b/tools/libclang/CMakeLists.txt
@@ -6,7 +6,6 @@
   clangSerialization
   clangSema
   clangEdit
-  clangComments
   clangAST
   clangLex
   clangBasic)
diff --git a/tools/libclang/Makefile b/tools/libclang/Makefile
index 78da067..8d0a614 100644
--- a/tools/libclang/Makefile
+++ b/tools/libclang/Makefile
@@ -19,7 +19,7 @@
 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
 
diff --git a/unittests/Frontend/Makefile b/unittests/Frontend/Makefile
index 357e242..f3e6396 100644
--- a/unittests/Frontend/Makefile
+++ b/unittests/Frontend/Makefile
@@ -14,6 +14,6 @@
            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
diff --git a/unittests/Tooling/Makefile b/unittests/Tooling/Makefile
index 84e05bb..5d6747d 100644
--- a/unittests/Tooling/Makefile
+++ b/unittests/Tooling/Makefile
@@ -12,6 +12,6 @@
 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