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.

llvm-svn: 158807
This commit is contained in:
Chandler Carruth 2012-06-20 09:53:52 +00:00
parent dca6fccd1f
commit 39a3e7544a
19 changed files with 13 additions and 35 deletions

View 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"

View File

@ -35,6 +35,7 @@ add_clang_library(clangAST
NestedNameSpecifier.cpp
NSAPI.cpp
ParentMap.cpp
RawCommentList.cpp
RecordLayout.cpp
RecordLayoutBuilder.cpp
SelectorLocationsKind.cpp

View 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"

View File

@ -15,4 +15,3 @@ add_subdirectory(Frontend)
add_subdirectory(FrontendTool)
add_subdirectory(Tooling)
add_subdirectory(StaticAnalyzer)
add_subdirectory(Comments)

View File

@ -1,6 +0,0 @@
set(LLVM_USED_LIBS clangBasic clangAST clangLex)
add_clang_library(clangComments
RawCommentList.cpp
)

View File

@ -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

View File

@ -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

View File

@ -4,7 +4,6 @@ set(LLVM_USED_LIBS
clangBasic
clangEdit
clangLex
clangComments
)
add_clang_library(clangSema

View 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

View 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

View 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

View 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

View 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

View 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

View File

@ -6,7 +6,6 @@ set(LLVM_USED_LIBS
clangSerialization
clangSema
clangEdit
clangComments
clangAST
clangLex
clangBasic)

View 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

View 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

View 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