]> 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>
Wed, 1 Mar 2023 18:24:18 +0000 (19:24 +0100)
commit3912f99ecae61dc7fe89c076a654332e3adb1bdc
tree98879561a779e2b41b6e77d2ff8d4d6dacc63a6e
parentb656161b84dce0322ab00d7958267fa47cda6318
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.)

MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38770

(cherry picked from commit ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71)
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