[cfe-commits] r141267 - in /cfe/trunk: CMakeLists.txt Makefile include/clang/AST/Makefile include/clang/Basic/Makefile include/clang/Driver/Makefile include/clang/Lex/Makefile include/clang/Parse/Makefile include/clang/Serialization/Makefile lib/Headers/Makefile lib/StaticAnalyzer/Checkers/Makefile

Peter Collingbourne peter at pcc.me.uk
Wed Oct 5 18:52:10 PDT 2011


Author: pcc
Date: Wed Oct  5 20:52:10 2011
New Revision: 141267

URL: http://llvm.org/viewvc/llvm-project?rev=141267&view=rev
Log:
Clang-side build system infrastructure for multiple tblgens.

Modified:
    cfe/trunk/CMakeLists.txt
    cfe/trunk/Makefile
    cfe/trunk/include/clang/AST/Makefile
    cfe/trunk/include/clang/Basic/Makefile
    cfe/trunk/include/clang/Driver/Makefile
    cfe/trunk/include/clang/Lex/Makefile
    cfe/trunk/include/clang/Parse/Makefile
    cfe/trunk/include/clang/Serialization/Makefile
    cfe/trunk/lib/Headers/Makefile
    cfe/trunk/lib/StaticAnalyzer/Checkers/Makefile

Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=141267&r1=141266&r2=141267&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Wed Oct  5 20:52:10 2011
@@ -19,10 +19,10 @@
     endif()
   endif()
 
-  if( NOT EXISTS "${CLANG_PATH_TO_LLVM_BUILD}/bin/tblgen${CMAKE_EXECUTABLE_SUFFIX}" )
-    # Looking for bin/Debug/tblgen is a complete hack. How can we get
+  if( NOT EXISTS "${CLANG_PATH_TO_LLVM_BUILD}/bin/llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}" )
+    # Looking for bin/Debug/llvm-tblgen is a complete hack. How can we get
     # around this?
-    if( NOT EXISTS "${CLANG_PATH_TO_LLVM_BUILD}/bin/Debug/tblgen${CMAKE_EXECUTABLE_SUFFIX}" )
+    if( NOT EXISTS "${CLANG_PATH_TO_LLVM_BUILD}/bin/Debug/llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}" )
       message(FATAL_ERROR "Please set CLANG_PATH_TO_LLVM_BUILD to a directory containing a LLVM build.")
     endif()
   endif()
@@ -46,11 +46,11 @@
   include_directories("${PATH_TO_LLVM_BUILD}/include" "${LLVM_MAIN_INCLUDE_DIR}")
   link_directories("${PATH_TO_LLVM_BUILD}/lib")
 
-  if( EXISTS "${CLANG_PATH_TO_LLVM_BUILD}/bin/tblgen${CMAKE_EXECUTABLE_SUFFIX}" )
-    set(LLVM_TABLEGEN_EXE "${PATH_TO_LLVM_BUILD}/bin/tblgen${CMAKE_EXECUTABLE_SUFFIX}")
+  if( EXISTS "${CLANG_PATH_TO_LLVM_BUILD}/bin/llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}" )
+    set(LLVM_TABLEGEN_EXE "${PATH_TO_LLVM_BUILD}/bin/llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}")
   else()
     # FIXME: This is an utter hack.
-    set(LLVM_TABLEGEN_EXE "${PATH_TO_LLVM_BUILD}/bin/Debug/tblgen${CMAKE_EXECUTABLE_SUFFIX}")
+    set(LLVM_TABLEGEN_EXE "${PATH_TO_LLVM_BUILD}/bin/Debug/llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}")
   endif()
 
   set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
@@ -153,7 +153,7 @@
   endif()
 
   set( LLVM_TARGET_DEFINITIONS ${CTG_SOURCE} )
-  tablegen( ${CTG_DEFAULT_ARGS} )
+  tablegen( LLVM ${CTG_DEFAULT_ARGS} )
 
   list( GET CTG_DEFAULT_ARGS 0 output_file )
   if( CTG_TARGET )

Modified: cfe/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Makefile?rev=141267&r1=141266&r2=141267&view=diff
==============================================================================
--- cfe/trunk/Makefile (original)
+++ cfe/trunk/Makefile Wed Oct  5 20:52:10 2011
@@ -60,6 +60,16 @@
 # We can revisit this when LLVM/Clang support it.
 CXX.Flags += -fno-strict-aliasing
 
+# Set up Clang's tblgen.
+ifndef CLANG_TBLGEN
+  ifeq ($(LLVM_CROSS_COMPILING),1)
+    CLANG_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
+  else
+    CLANG_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
+  endif
+endif
+ClangTableGen = $(CLANG_TBLGEN) $(TableGen.Flags)
+
 ###
 # Clang Top Level specific stuff.
 

Modified: cfe/trunk/include/clang/AST/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Makefile?rev=141267&r1=141266&r2=141267&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Makefile (original)
+++ cfe/trunk/include/clang/AST/Makefile Wed Oct  5 20:52:10 2011
@@ -6,24 +6,24 @@
 
 include $(CLANG_LEVEL)/Makefile
 
-$(ObjDir)/Attrs.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
+$(ObjDir)/Attrs.inc.tmp : $(TD_SRC_DIR)/Attr.td $(CLANG_TBLGEN) \
                               $(ObjDir)/.dir
 	$(Echo) "Building Clang attribute classes with tblgen"
-	$(Verb) $(TableGen) -gen-clang-attr-classes -o $(call SYSPATH, $@) \
+	$(Verb) $(ClangTableGen) -gen-clang-attr-classes -o $(call SYSPATH, $@) \
 		-I $(PROJ_SRC_DIR)/../../ $<
 
-$(ObjDir)/AttrImpl.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
+$(ObjDir)/AttrImpl.inc.tmp : $(TD_SRC_DIR)/Attr.td $(CLANG_TBLGEN) \
                               $(ObjDir)/.dir
 	$(Echo) "Building Clang attribute implementations with tblgen"
-	$(Verb) $(TableGen) -gen-clang-attr-impl -o $(call SYSPATH, $@) \
+	$(Verb) $(ClangTableGen) -gen-clang-attr-impl -o $(call SYSPATH, $@) \
 		-I $(PROJ_SRC_DIR)/../../ $<
 
-$(ObjDir)/StmtNodes.inc.tmp : $(TD_SRC_DIR)/StmtNodes.td $(TBLGEN) \
+$(ObjDir)/StmtNodes.inc.tmp : $(TD_SRC_DIR)/StmtNodes.td $(CLANG_TBLGEN) \
                               $(ObjDir)/.dir
 	$(Echo) "Building Clang statement node tables with tblgen"
-	$(Verb) $(TableGen) -gen-clang-stmt-nodes -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-clang-stmt-nodes -o $(call SYSPATH, $@) $<
 
-$(ObjDir)/DeclNodes.inc.tmp : $(TD_SRC_DIR)/DeclNodes.td $(TBLGEN) \
+$(ObjDir)/DeclNodes.inc.tmp : $(TD_SRC_DIR)/DeclNodes.td $(CLANG_TBLGEN) \
                               $(ObjDir)/.dir
 	$(Echo) "Building Clang declaration node tables with tblgen"
-	$(Verb) $(TableGen) -gen-clang-decl-nodes -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-clang-decl-nodes -o $(call SYSPATH, $@) $<

Modified: cfe/trunk/include/clang/Basic/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Makefile?rev=141267&r1=141266&r2=141267&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Makefile (original)
+++ cfe/trunk/include/clang/Basic/Makefile Wed Oct  5 20:52:10 2011
@@ -29,26 +29,26 @@
 CLANG_HAS_VERSION_PATCHLEVEL := 1
 endif
 
-$(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td Diagnostic%Kinds.td $(TBLGEN) $(ObjDir)/.dir
+$(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td Diagnostic%Kinds.td $(CLANG_TBLGEN) $(ObjDir)/.dir
 	$(Echo) "Building Clang $(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) diagnostic tables with tblgen"
-	$(Verb) $(TableGen) -gen-clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) -o $(call SYSPATH, $@) $<
 
-$(ObjDir)/DiagnosticIndexName.inc.tmp : Diagnostic.td $(INPUT_TDS) $(TBLGEN) $(ObjDir)/.dir
+$(ObjDir)/DiagnosticIndexName.inc.tmp : Diagnostic.td $(INPUT_TDS) $(CLANG_TBLGEN) $(ObjDir)/.dir
 	$(Echo) "Building Clang diagnostic name index with tblgen"
-	$(Verb) $(TableGen) -gen-clang-diags-index-name -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-clang-diags-index-name -o $(call SYSPATH, $@) $<
 
-$(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td DiagnosticGroups.td $(INPUT_TDS) $(TBLGEN) $(ObjDir)/.dir
+$(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td DiagnosticGroups.td $(INPUT_TDS) $(CLANG_TBLGEN) $(ObjDir)/.dir
 	$(Echo) "Building Clang diagnostic groups with tblgen"
-	$(Verb) $(TableGen) -gen-clang-diag-groups -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-clang-diag-groups -o $(call SYSPATH, $@) $<
 
-$(ObjDir)/AttrList.inc.tmp : Attr.td $(TBLGEN) $(ObjDir)/.dir
+$(ObjDir)/AttrList.inc.tmp : Attr.td $(CLANG_TBLGEN) $(ObjDir)/.dir
 	$(Echo) "Building Clang attribute list with tblgen"
-	$(Verb) $(TableGen) -gen-clang-attr-list -o $(call SYSPATH, $@) \
+	$(Verb) $(ClangTableGen) -gen-clang-attr-list -o $(call SYSPATH, $@) \
 	  -I $(PROJ_SRC_DIR)/../.. $<
 
-$(ObjDir)/arm_neon.inc.tmp : arm_neon.td $(TBLGEN) $(ObjDir)/.dir
+$(ObjDir)/arm_neon.inc.tmp : arm_neon.td $(CLANG_TBLGEN) $(ObjDir)/.dir
 	$(Echo) "Building Clang arm_neon.inc with tblgen"
-	$(Verb) $(TableGen) -gen-arm-neon-sema -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-arm-neon-sema -o $(call SYSPATH, $@) $<
 
 $(ObjDir)/Version.inc.tmp : Version.inc.in Makefile $(LLVM_OBJ_ROOT)/Makefile.config $(ObjDir)/.dir
 	$(Echo) "Updating Clang version info."

Modified: cfe/trunk/include/clang/Driver/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Makefile?rev=141267&r1=141266&r2=141267&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Makefile (original)
+++ cfe/trunk/include/clang/Driver/Makefile Wed Oct  5 20:52:10 2011
@@ -5,14 +5,14 @@
 
 include $(CLANG_LEVEL)/Makefile
 
-$(ObjDir)/Options.inc.tmp : Options.td OptParser.td $(TBLGEN) $(ObjDir)/.dir
+$(ObjDir)/Options.inc.tmp : Options.td OptParser.td $(CLANG_TBLGEN) $(ObjDir)/.dir
 	$(Echo) "Building Clang Driver Option tables with tblgen"
-	$(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
 
-$(ObjDir)/CC1Options.inc.tmp : CC1Options.td OptParser.td $(TBLGEN) $(ObjDir)/.dir
+$(ObjDir)/CC1Options.inc.tmp : CC1Options.td OptParser.td $(CLANG_TBLGEN) $(ObjDir)/.dir
 	$(Echo) "Building Clang CC1 Option tables with tblgen"
-	$(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
 
-$(ObjDir)/CC1AsOptions.inc.tmp : CC1AsOptions.td OptParser.td $(TBLGEN) $(ObjDir)/.dir
+$(ObjDir)/CC1AsOptions.inc.tmp : CC1AsOptions.td OptParser.td $(CLANG_TBLGEN) $(ObjDir)/.dir
 	$(Echo) "Building Clang CC1 Assembler Option tables with tblgen"
-	$(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<

Modified: cfe/trunk/include/clang/Lex/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Makefile?rev=141267&r1=141266&r2=141267&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Makefile (original)
+++ cfe/trunk/include/clang/Lex/Makefile Wed Oct  5 20:52:10 2011
@@ -6,8 +6,8 @@
 
 include $(CLANG_LEVEL)/Makefile
 
-$(ObjDir)/AttrSpellings.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
+$(ObjDir)/AttrSpellings.inc.tmp : $(TD_SRC_DIR)/Attr.td $(CLANG_TBLGEN) \
                                   $(ObjDir)/.dir
 	$(Echo) "Building Clang attribute spellings with tblgen"
-	$(Verb) $(TableGen) -gen-clang-attr-spelling-list -o $(call SYSPATH, $@) \
+	$(Verb) $(ClangTableGen) -gen-clang-attr-spelling-list -o $(call SYSPATH, $@) \
 		-I $(PROJ_SRC_DIR)/../../ $<

Modified: cfe/trunk/include/clang/Parse/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Makefile?rev=141267&r1=141266&r2=141267&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Makefile (original)
+++ cfe/trunk/include/clang/Parse/Makefile Wed Oct  5 20:52:10 2011
@@ -6,8 +6,8 @@
 
 include $(CLANG_LEVEL)/Makefile
 
-$(ObjDir)/AttrLateParsed.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
+$(ObjDir)/AttrLateParsed.inc.tmp : $(TD_SRC_DIR)/Attr.td $(CLANG_TBLGEN) \
                                    $(ObjDir)/.dir
 	$(Echo) "Building Clang attribute late-parsed table with tblgen"
-	$(Verb) $(TableGen) -gen-clang-attr-late-parsed-list -o $(call SYSPATH, $@) \
+	$(Verb) $(ClangTableGen) -gen-clang-attr-late-parsed-list -o $(call SYSPATH, $@) \
 		-I $(PROJ_SRC_DIR)/../../ $<
\ No newline at end of file

Modified: cfe/trunk/include/clang/Serialization/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/Makefile?rev=141267&r1=141266&r2=141267&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/Makefile (original)
+++ cfe/trunk/include/clang/Serialization/Makefile Wed Oct  5 20:52:10 2011
@@ -6,14 +6,14 @@
 
 include $(CLANG_LEVEL)/Makefile
 
-$(ObjDir)/AttrPCHRead.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
+$(ObjDir)/AttrPCHRead.inc.tmp : $(TD_SRC_DIR)/Attr.td $(CLANG_TBLGEN) \
                               $(ObjDir)/.dir
 	$(Echo) "Building Clang PCH reader with tblgen"
-	$(Verb) $(TableGen) -gen-clang-attr-pch-read -o $(call SYSPATH, $@) \
+	$(Verb) $(ClangTableGen) -gen-clang-attr-pch-read -o $(call SYSPATH, $@) \
 		-I $(PROJ_SRC_DIR)/../../ $<
 
-$(ObjDir)/AttrPCHWrite.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
+$(ObjDir)/AttrPCHWrite.inc.tmp : $(TD_SRC_DIR)/Attr.td $(CLANG_TBLGEN) \
                               $(ObjDir)/.dir
 	$(Echo) "Building Clang PCH writer with tblgen"
-	$(Verb) $(TableGen) -gen-clang-attr-pch-write -o $(call SYSPATH, $@) \
+	$(Verb) $(ClangTableGen) -gen-clang-attr-pch-write -o $(call SYSPATH, $@) \
 		-I $(PROJ_SRC_DIR)/../../ $<

Modified: cfe/trunk/lib/Headers/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/Makefile?rev=141267&r1=141266&r2=141267&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/Makefile (original)
+++ cfe/trunk/lib/Headers/Makefile Wed Oct  5 20:52:10 2011
@@ -49,6 +49,6 @@
 
 install-local:: $(INSTHEADERS)
 
-$(ObjDir)/arm_neon.h.inc.tmp : $(CLANG_LEVEL)/include/clang/Basic/arm_neon.td $(TBLGEN) $(ObjDir)/.dir
+$(ObjDir)/arm_neon.h.inc.tmp : $(CLANG_LEVEL)/include/clang/Basic/arm_neon.td $(CLANG_TBLGEN) $(ObjDir)/.dir
 	$(Echo) "Building Clang arm_neon.h.inc with tblgen"
-	$(Verb) $(TableGen) -gen-arm-neon -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-arm-neon -o $(call SYSPATH, $@) $<

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/Makefile?rev=141267&r1=141266&r2=141267&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/Makefile (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/Makefile Wed Oct  5 20:52:10 2011
@@ -19,6 +19,6 @@
 
 include $(CLANG_LEVEL)/Makefile
 
-$(ObjDir)/Checkers.inc.tmp : Checkers.td $(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include/clang/StaticAnalyzer/Checkers/CheckerBase.td $(TBLGEN) $(ObjDir)/.dir
+$(ObjDir)/Checkers.inc.tmp : Checkers.td $(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include/clang/StaticAnalyzer/Checkers/CheckerBase.td $(CLANG_TBLGEN) $(ObjDir)/.dir
 	$(Echo) "Building Clang SA Checkers tables with tblgen"
-	$(Verb) $(TableGen) -gen-clang-sa-checkers -I $(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include -o $(call SYSPATH, $@) $<
+	$(Verb) $(ClangTableGen) -gen-clang-sa-checkers -I $(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include -o $(call SYSPATH, $@) $<





More information about the cfe-commits mailing list