diagnostics. This builds on the patch that Sebastian committed and
then revert. Major differences are:
- We don't remove or use the current ".def" files. Instead, for now,
we just make sure that we're building the ".inc" files.
- Fixed CMake makefiles to run TableGen and build the ".inc" files
when needed. Tested with both the Xcode and Makefile generators
provided by CMake, so it should be solid.
- Fixed normal makefiles to handle out-of-source builds that involve
the ".inc" files.
I'll send a separate patch to the list with Sebastian's changes that
eliminate the use of the .def files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67058
91177308-0d34-0410-b5e6-
96231b3b80d8
if( LLVM_COMMON_DEPENDS )
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
endif( LLVM_COMMON_DEPENDS )
+ add_dependencies(${name} ClangDiagnosticCommon)
if(MSVC)
get_target_property(cflag ${name} COMPILE_FLAGS)
if(NOT cflag)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_BINARY_DIR}/include
)
install(DIRECTORY include
add_definitions( -D_GNU_SOURCE )
+add_subdirectory(include)
add_subdirectory(lib)
add_subdirectory(Driver)
LEVEL = ../../..
TOOLNAME = clang
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../include -I$(PROJ_OBJ_DIR)/../include
CXXFLAGS = -fno-rtti
# Clang has no plugins, optimize startup time.
LEVEL = ../..
-DIRS := lib Driver docs tools
+DIRS := include lib Driver docs tools
include $(LEVEL)/Makefile.common
--- /dev/null
+add_subdirectory(clang)
--- /dev/null
+LEVEL = ../../..
+DIRS := clang
+
+include $(LEVEL)/Makefile.common
--- /dev/null
+macro(clang_diag_gen component)
+ tablegen(Diagnostic${component}Kinds.inc
+ -gen-clang-diags-defs -clang-component=${component})
+ add_custom_target(ClangDiagnostic${component}
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Diagnostic${component}Kinds.inc)
+endmacro(clang_diag_gen)
+
+set(LLVM_TARGET_DEFINITIONS Diagnostic.td)
+clang_diag_gen(Analysis)
+clang_diag_gen(AST)
+clang_diag_gen(Common)
+clang_diag_gen(Driver)
+clang_diag_gen(Frontend)
+clang_diag_gen(Lex)
+clang_diag_gen(Parse)
+clang_diag_gen(Sema)
\ No newline at end of file
--- /dev/null
+LEVEL = ../../../../..
+BUILT_SOURCES = DiagnosticAnalysisKinds.inc DiagnosticASTKinds.inc \
+ DiagnosticCommonKinds.inc DiagnosticDriverKinds.inc \
+ DiagnosticFrontendKinds.inc DiagnosticLexKinds.inc \
+ DiagnosticParseKinds.inc DiagnosticSemaKinds.inc
+
+CLANG_BUILD_DIAGNOSTICS_INC = 1
+
+include $(LEVEL)/Makefile.common
--- /dev/null
+add_subdirectory(Basic)
--- /dev/null
+LEVEL = ../../../..
+DIRS := Basic
+
+include $(LEVEL)/Makefile.common
Type.cpp
TypeSerialization.cpp
)
+
+add_dependencies(clangAST ClangDiagnosticAST)
BUILD_ARCHIVE = 1
CXXFLAGS = -fno-rtti
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common
SymbolManager.cpp
UninitializedValues.cpp
)
+
+add_dependencies(clangAnalysis ClangDiagnosticAnalysis)
BUILD_ARCHIVE = 1
CXXFLAGS = -fno-rtti
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common
Targets.cpp
TokenKinds.cpp
)
+
+add_dependencies(clangBasic
+ ClangDiagnosticAnalysis
+ ClangDiagnosticAST
+ ClangDiagnosticCommon
+ ClangDiagnosticDriver
+ ClangDiagnosticFrontend
+ ClangDiagnosticLex
+ ClangDiagnosticParse
+ ClangDiagnosticSema)
BUILD_ARCHIVE = 1
CXXFLAGS = -fno-rtti
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common
BUILD_ARCHIVE = 1
CXXFLAGS = -fno-rtti
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common
BUILD_ARCHIVE = 1
CXXFLAGS = -fno-rtti
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common
BUILD_ARCHIVE = 1
CXXFLAGS = -fno-rtti
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common
TokenLexer.cpp
TokenConcatenation.cpp
)
+
+add_dependencies(clangLex ClangDiagnosticLex)
CXXFLAGS += -maltivec
endif
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common
ParseTentative.cpp
ParseTemplate.cpp
)
+
+add_dependencies(clangParse ClangDiagnosticParse)
BUILD_ARCHIVE = 1
CXXFLAGS = -fno-rtti
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common
BUILD_ARCHIVE = 1
CXXFLAGS = -fno-rtti
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common
SemaTemplateInstantiate.cpp
SemaType.cpp
)
+
+add_dependencies(clangSema ClangDiagnosticSema)
BUILD_ARCHIVE = 1
CXXFLAGS = -fno-rtti
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common
LEVEL = ../../../..
TOOLNAME = clang-driver
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
CXXFLAGS = -fno-rtti
# FIXME: It is unfortunate we need to pull in the bitcode reader and