]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Ensure .inc files are regenerated when llvm/clang tblgen binaries change
authorDimitry Andric <dim@FreeBSD.org>
Sat, 25 Feb 2023 15:25:57 +0000 (16:25 +0100)
committerDimitry Andric <dim@FreeBSD.org>
Sat, 4 Mar 2023 20:17:27 +0000 (21:17 +0100)
commit8534a7f045bd50240b7dfb417c2240d8aee6646d
tree30e8d1c2efe91619f1bf46302febb73aefd19feb
parent13264ea9a370bac94da680a929c3f548209ff94d
Ensure .inc files are regenerated when llvm/clang tblgen binaries change

When doing a fully incremental build (with WITHOUT_CLEAN enabled), from
a commit before llvm 15 was merged (3264f6b88fce), to a commit after
that, a number of .inc files were not regenerated. This could lead to
unexpected compilation errors when these .inc files were included from
llvm-project sources, similar to:

  In file included from /usr/src/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:8268:
  /usr/obj/usr/src/amd64.amd64/lib/clang/libclang/clang/Basic/arm_mve_builtin_cg.inc:279:18: error: no matching constructor for initialization of 'clang::CodeGen::Address'
    Address Val2 = Address(Val1, CharUnits::fromQuantity(2));
                   ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Work around this by making the .inc files dependent on the tblgen binary
used for generating them. E.g., we can relatively safely assume that if
the binary gets updated, the .inc files must also be updated. (Although
this is not 100% optimal, the gain by complicating things even more is
probaby not worth the effort.)

Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38770

(cherry picked from commit ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71)
(cherry picked from commit 3912f99ecae61dc7fe89c076a654332e3adb1bdc)
17 files changed:
lib/clang/clang.pre.mk
lib/clang/headers/Makefile
lib/clang/libclang/Makefile
lib/clang/liblldb/Makefile
lib/clang/libllvm/Makefile
lib/clang/llvm.pre.mk
usr.bin/clang/lld/Makefile
usr.bin/clang/lldb-server/Makefile
usr.bin/clang/lldb/Makefile
usr.bin/clang/llvm-cxxfilt/Makefile
usr.bin/clang/llvm-nm/Makefile
usr.bin/clang/llvm-objcopy/Makefile
usr.bin/clang/llvm-objdump/Makefile
usr.bin/clang/llvm-readobj/Makefile
usr.bin/clang/llvm-size/Makefile
usr.bin/clang/llvm-strings/Makefile
usr.bin/clang/llvm-symbolizer/Makefile