From 4dc3b1fa1bbcf20f7713d94776a1604964ada32b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 29 Mar 2023 20:37:02 +0200 Subject: [PATCH] Revert "Ensure .inc files are regenerated when llvm/clang tblgen binaries change" This reverts commit ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71. The intent of this change was to avoid possible compilation errors when certain .inc files were not regenerated, but the method turns out to cause way more rebuilds than anticipated. Another method will have to be found, and in the mean time, WITH_CLEAN is the solution that always works. Fixes: ab80f0b21fbb --- lib/clang/clang.pre.mk | 1 - lib/clang/headers/Makefile | 2 -- lib/clang/libclang/Makefile | 22 +++++++--------------- lib/clang/liblldb/Makefile | 3 --- lib/clang/libllvm/Makefile | 2 -- lib/clang/llvm.pre.mk | 1 - usr.bin/clang/lld/Makefile | 2 -- usr.bin/clang/lldb-server/Makefile | 2 -- usr.bin/clang/lldb/Makefile | 2 -- usr.bin/clang/llvm-cxxfilt/Makefile | 2 -- usr.bin/clang/llvm-dwarfutil/Makefile | 2 -- usr.bin/clang/llvm-nm/Makefile | 2 -- usr.bin/clang/llvm-objcopy/Makefile | 2 -- usr.bin/clang/llvm-objdump/Makefile | 2 -- usr.bin/clang/llvm-readobj/Makefile | 2 -- usr.bin/clang/llvm-size/Makefile | 2 -- usr.bin/clang/llvm-strings/Makefile | 2 -- usr.bin/clang/llvm-symbolizer/Makefile | 2 -- 18 files changed, 7 insertions(+), 48 deletions(-) diff --git a/lib/clang/clang.pre.mk b/lib/clang/clang.pre.mk index 9ef401645f14..520a9300e6ce 100644 --- a/lib/clang/clang.pre.mk +++ b/lib/clang/clang.pre.mk @@ -5,4 +5,3 @@ CLANG_SRCS= ${LLVM_BASE}/clang CLANG_TBLGEN?= clang-tblgen -CLANG_TBLGEN_BIN!= which ${CLANG_TBLGEN} diff --git a/lib/clang/headers/Makefile b/lib/clang/headers/Makefile index df53b7dc7ea0..4e5a08e9fed2 100644 --- a/lib/clang/headers/Makefile +++ b/lib/clang/headers/Makefile @@ -214,8 +214,6 @@ riscv_${hdr:H}.h: ${CLANG_SRCS}/include/clang/Basic/riscv_${hdr:H}.td GENINCS+= riscv_${hdr:H}.h .endfor -${GENINCS}: ${CLANG_TBLGEN_BIN} - CLEANFILES= ${GENINCS} ${GENINCS:C/$/.d/} .include diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile index ac85db06ed58..7181da12a065 100644 --- a/lib/clang/libclang/Makefile +++ b/lib/clang/libclang/Makefile @@ -1037,6 +1037,13 @@ clang/Basic/riscv_vector_builtin_sema.inc: \ -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/riscv_vector.td TGHDRS+= clang/Basic/riscv_vector_builtin_sema.inc +clang/Driver/Options.inc: ${CLANG_SRCS}/include/clang/Driver/Options.td + ${LLVM_TBLGEN} -gen-opt-parser-defs \ + -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ + -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Driver/Options.td +TGHDRS+= clang/Driver/Options.inc + clang/Parse/AttrParserStringSwitches.inc: \ ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parser-string-switches \ @@ -1114,25 +1121,10 @@ OpenCLBuiltins.inc: ${CLANG_SRCS}/lib/Sema/OpenCLBuiltins.td ${CLANG_SRCS}/lib/Sema/OpenCLBuiltins.td TGHDRS+= OpenCLBuiltins.inc -${TGHDRS}: ${CLANG_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} -clang/Driver/Options.inc: ${CLANG_SRCS}/include/clang/Driver/Options.td - ${LLVM_TBLGEN} -gen-opt-parser-defs \ - -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ - -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ - ${CLANG_SRCS}/include/clang/Driver/Options.td -LTGHDRS+= clang/Driver/Options.inc - -${LTGHDRS}: ${LLVM_TBLGEN_BIN} - -DEPENDFILES+= ${LTGHDRS:C/$/.d/} -DPSRCS+= ${LTGHDRS} -CLEANFILES+= ${LTGHDRS} ${LTGHDRS:C/$/.d/} - .include "../clang.build.mk" INTERNALLIB= diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile index 1a1494fd2bfb..e5590ff1e536 100644 --- a/lib/clang/liblldb/Makefile +++ b/lib/clang/liblldb/Makefile @@ -701,7 +701,6 @@ SRCS+= Utility/XcodeSDK.cpp SRCS+= Version/Version.cpp LLDB_TBLGEN?= lldb-tblgen -LLDB_TBLGEN_BIN!= which ${LLDB_TBLGEN} CommandOptions.inc: ${LLDB_SRCS}/source/Commands/Options.td ${LLDB_TBLGEN} -gen-lldb-option-defs \ @@ -729,8 +728,6 @@ ${path:T}PropertiesEnum.inc: ${LLDB_SRCS}/source/${path}Properties.td TGHDRS+= ${path:T}PropertiesEnum.inc .endfor -${TGHDRS}: ${LLDB_TBLGEN_BIN} - DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index 1cfd75f509c0..a031f0fdd706 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -2128,8 +2128,6 @@ TGHDRS+= X86GenRegisterInfo.inc TGHDRS+= X86GenSubtargetInfo.inc .endif # MK_LLVM_TARGET_X86 -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/lib/clang/llvm.pre.mk b/lib/clang/llvm.pre.mk index 92124a7bf092..774d7d47ea37 100644 --- a/lib/clang/llvm.pre.mk +++ b/lib/clang/llvm.pre.mk @@ -5,4 +5,3 @@ LLVM_BASE= ${SRCTOP}/contrib/llvm-project LLVM_SRCS= ${LLVM_BASE}/llvm LLVM_TBLGEN?= llvm-tblgen -LLVM_TBLGEN_BIN!= which ${LLVM_TBLGEN} diff --git a/usr.bin/clang/lld/Makefile b/usr.bin/clang/lld/Makefile index 150f74b90984..aed22a7ae847 100644 --- a/usr.bin/clang/lld/Makefile +++ b/usr.bin/clang/lld/Makefile @@ -95,8 +95,6 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/lldb-server/Makefile b/usr.bin/clang/lldb-server/Makefile index b11fbfbbef33..532c2aa2047a 100644 --- a/usr.bin/clang/lldb-server/Makefile +++ b/usr.bin/clang/lldb-server/Makefile @@ -37,8 +37,6 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/lldb/Makefile b/usr.bin/clang/lldb/Makefile index b6486756d882..0637b8844cad 100644 --- a/usr.bin/clang/lldb/Makefile +++ b/usr.bin/clang/lldb/Makefile @@ -30,8 +30,6 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-cxxfilt/Makefile b/usr.bin/clang/llvm-cxxfilt/Makefile index 0ce39d66f0f5..0036fbe6cf8d 100644 --- a/usr.bin/clang/llvm-cxxfilt/Makefile +++ b/usr.bin/clang/llvm-cxxfilt/Makefile @@ -21,8 +21,6 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-dwarfutil/Makefile b/usr.bin/clang/llvm-dwarfutil/Makefile index 6dd9bd2d5259..a436acf0e197 100644 --- a/usr.bin/clang/llvm-dwarfutil/Makefile +++ b/usr.bin/clang/llvm-dwarfutil/Makefile @@ -18,8 +18,6 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-nm/Makefile b/usr.bin/clang/llvm-nm/Makefile index d3099e5a75be..0df48744632d 100644 --- a/usr.bin/clang/llvm-nm/Makefile +++ b/usr.bin/clang/llvm-nm/Makefile @@ -19,8 +19,6 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-objcopy/Makefile b/usr.bin/clang/llvm-objcopy/Makefile index 5cdbf5e32d2d..20f5f191b766 100644 --- a/usr.bin/clang/llvm-objcopy/Makefile +++ b/usr.bin/clang/llvm-objcopy/Makefile @@ -23,8 +23,6 @@ ${hdr}.inc: ${LLVM_BASE}/${SRCDIR}/${hdr}.td TGHDRS+= ${hdr}.inc .endfor -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-objdump/Makefile b/usr.bin/clang/llvm-objdump/Makefile index b4286ffec623..c20bc172528f 100644 --- a/usr.bin/clang/llvm-objdump/Makefile +++ b/usr.bin/clang/llvm-objdump/Makefile @@ -26,8 +26,6 @@ ${hdr}.inc: ${LLVM_BASE}/${SRCDIR}/${hdr}.td TGHDRS+= ${hdr}.inc .endfor -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-readobj/Makefile b/usr.bin/clang/llvm-readobj/Makefile index 8926eb03bdbf..4b547d81c583 100644 --- a/usr.bin/clang/llvm-readobj/Makefile +++ b/usr.bin/clang/llvm-readobj/Makefile @@ -30,8 +30,6 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-size/Makefile b/usr.bin/clang/llvm-size/Makefile index f39e5db6f872..20bd5de61192 100644 --- a/usr.bin/clang/llvm-size/Makefile +++ b/usr.bin/clang/llvm-size/Makefile @@ -19,8 +19,6 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-strings/Makefile b/usr.bin/clang/llvm-strings/Makefile index 253766ba084d..1438aa847997 100644 --- a/usr.bin/clang/llvm-strings/Makefile +++ b/usr.bin/clang/llvm-strings/Makefile @@ -17,8 +17,6 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-symbolizer/Makefile b/usr.bin/clang/llvm-symbolizer/Makefile index ae417356df6b..c4677169f912 100644 --- a/usr.bin/clang/llvm-symbolizer/Makefile +++ b/usr.bin/clang/llvm-symbolizer/Makefile @@ -20,8 +20,6 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} -${TGHDRS}: ${LLVM_TBLGEN_BIN} - DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/}