History log of /freebsd-current/lib/clang/libclang/Makefile
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 7a6dacac 24-Jan-2024 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-18-init-18359-g93248729cfae

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-18359-g93248729cfae, the
last commit before the upstream release/18.x branch was created.

PR: 276104
MFC after: 1 month


# cb14a3fe 25-Dec-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-18-init-15692-g007ed0dccd6a

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-15692-g007ed0dccd6a.

PR: 276104
MFC after: 1 month


# 5f757f3f 18-Dec-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-15088-gd14ee76181fb.

PR: 276104
MFC after: 1 month


# 73ff7384 11-Feb-2024 Dimitry Andric <dim@FreeBSD.org>

Optionally create full debuginfo for llvm-related executables

Commit de6feefdb7cfd limited the amount of debuginfo generated for clang
and other llvm-related executables. This was done to save disk space and
memory during building, but it makes debugging any of these executables
much harder.

Add a new src.conf(5) setting, WITH_LLVM_FULL_DEBUGINFO, to generate
full debuginfo instead. This is off by default, but could for example be
enabled for release builds or snapshots, so llvm executables are easier
to debug.

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43839

# 06c3fb27 02-Sep-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the
last commit before the upstream release/17.x branch was created.

PR: 273753
MFC after: 1 month


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

# bdd1243d 14-Apr-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16-init-18548-gb0daacf58f41.

PR: 271047
MFC after: 1 month


# 4dc3b1fa 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

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

# d8ed7fa3 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed"

This reverts commit 8f391d9098083044793ff036dff8c96930fb1553. There are
still a bunch of problems, and apparently ${.ALLSRC} does not work as I
expected.

Fixes: 8f391d909808

# 8f391d90 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed

This flag ensures that the tblgen tools do not actually touch the
produced .inc file, if there are no changes to the contents. In turn,
this may prevent a number of rebuilds of files that include such .inc
files, saving build time.

While here, ensure that the shell invocations to locate the used tblgen
binary do not show unnecessary error messages.

Reported by: des
MFC after: 1 week

# ab80f0b2 25-Feb-2023 Dimitry Andric <dim@FreeBSD.org>

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

# 972a253a 27-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17826-g1f8ae9d7e7e4, the last commit before
the upstream release/16.x branch was created.

PR: 265425
MFC after: 2 weeks


# 753f127f 14-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR: 265425
MFC after: 2 weeks


# 81ad6265 04-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks


# 1838bd0f 05-Feb-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project release/14.x llvmorg-14-init-18315-g190be5457c90

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18315-g190be5457c90.

PR: 261742
MFC after: 2 weeks


# 04eeddc0 27-Jan-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR: 261742
MFC after: 2 weeks


# 4824e7fd 02-Dec-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-11187-g222442ec2d71

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-11187-g222442ec2d71.

PR: 261742
MFC after: 2 weeks


# 5e801ac6 20-Nov-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR: 261742
MFC after: 2 weeks


# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 20885331 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Put clang/lib/Tooling/Core/Replacement.cpp under SRCS_MIN, since it is
required by both the static analyzer (MK_CLANG_FULL) and clang-format
(MK_CLANG_FORMAT). We could also invent yet another SRCS variant, but
that seems a bit overkill.

# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 0a9ab9f5 24-Jun-2020 Conrad Meyer <cem@FreeBSD.org>

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT. Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D25427

# c357f7d2 26-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a full build (MK_CLANG_FULL=yes) of the clang
executable.

# 9771cac2 25-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a1aaa66b 20-Nov-2019 Dimitry Andric <dim@FreeBSD.org>

Add explanatory comments for the different SRCS_xxx variables used in
the Makefiles for libllvm and libclang. While here, cleanup a commented
out SRCS entry in libllvmminimal's Makefile.

MFC after: 3 days

# 23559b6a 24-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang including the static analyzer
(enabled via MK_CLANG_FULL).

# 4014a71f 23-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# efa75597 21-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update llvm and clang build glue to make MK_CLANG_EXTRAS=yes and
MK_CLANG_FULL=yes work.

# 5e86819c 20-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Add and remove sources from libllvm and libclang, to make the minimal
clang executable (with all options except targets off) build.

# 99be4f2a 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue for upstream r338536 import.

# 67b158f6 01-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build blue to make WITH_CLANG_EXTRAS and WITH_CLANG_FULL work.

# 9f6e9a9f 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Make the minimal clang executable build.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 44389c28 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Sort source file lists under lib/clang.

# ea68f99b 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make the full clang
executable build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# ddf95e2a 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Tell bsd.dep.mk which depend files to dinclude.

This allows the _SKIP_DEPEND optimization to work, avoiding reading
the files when not needed. It also fixes META_MODE incorrectly
reading these files when not needed.

Sponsored by: Dell EMC Isilon

# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 89cb50c9 30-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and update
build glue.


# 302affcb 29-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304149, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 482a8244 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update some more build glue. All llvm extras, lld and lldb should link now.

# 050e2df1 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add new objects to lib/clang/lib{llvm,clang} and usr.bin/clang for the
MK_CLANG_EXTRAS=yes case.

# 3762ddd9 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add some new objects to libclang for the MK_CLANG_FULL=yes case.

# 5897d2f0 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Initial update of clang/llvm build glue, for building just a minimal
clang executable.

# 2714e44c 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Fix some erroneous minimization in libclang.

# f1a29dd3 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb release_40 branch r292009. Also update
build glue.


# 24e2fe98 09-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb trunk r291476.


# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 73ff7384 11-Feb-2024 Dimitry Andric <dim@FreeBSD.org>

Optionally create full debuginfo for llvm-related executables

Commit de6feefdb7cfd limited the amount of debuginfo generated for clang
and other llvm-related executables. This was done to save disk space and
memory during building, but it makes debugging any of these executables
much harder.

Add a new src.conf(5) setting, WITH_LLVM_FULL_DEBUGINFO, to generate
full debuginfo instead. This is off by default, but could for example be
enabled for release builds or snapshots, so llvm executables are easier
to debug.

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43839


# 06c3fb27 02-Sep-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the
last commit before the upstream release/17.x branch was created.

PR: 273753
MFC after: 1 month


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

# bdd1243d 14-Apr-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16-init-18548-gb0daacf58f41.

PR: 271047
MFC after: 1 month


# 4dc3b1fa 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

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

# d8ed7fa3 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed"

This reverts commit 8f391d9098083044793ff036dff8c96930fb1553. There are
still a bunch of problems, and apparently ${.ALLSRC} does not work as I
expected.

Fixes: 8f391d909808

# 8f391d90 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed

This flag ensures that the tblgen tools do not actually touch the
produced .inc file, if there are no changes to the contents. In turn,
this may prevent a number of rebuilds of files that include such .inc
files, saving build time.

While here, ensure that the shell invocations to locate the used tblgen
binary do not show unnecessary error messages.

Reported by: des
MFC after: 1 week

# ab80f0b2 25-Feb-2023 Dimitry Andric <dim@FreeBSD.org>

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

# 972a253a 27-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17826-g1f8ae9d7e7e4, the last commit before
the upstream release/16.x branch was created.

PR: 265425
MFC after: 2 weeks


# 753f127f 14-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR: 265425
MFC after: 2 weeks


# 81ad6265 04-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks


# 1838bd0f 05-Feb-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project release/14.x llvmorg-14-init-18315-g190be5457c90

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18315-g190be5457c90.

PR: 261742
MFC after: 2 weeks


# 04eeddc0 27-Jan-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR: 261742
MFC after: 2 weeks


# 4824e7fd 02-Dec-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-11187-g222442ec2d71

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-11187-g222442ec2d71.

PR: 261742
MFC after: 2 weeks


# 5e801ac6 20-Nov-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR: 261742
MFC after: 2 weeks


# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 20885331 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Put clang/lib/Tooling/Core/Replacement.cpp under SRCS_MIN, since it is
required by both the static analyzer (MK_CLANG_FULL) and clang-format
(MK_CLANG_FORMAT). We could also invent yet another SRCS variant, but
that seems a bit overkill.

# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 0a9ab9f5 24-Jun-2020 Conrad Meyer <cem@FreeBSD.org>

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT. Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D25427

# c357f7d2 26-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a full build (MK_CLANG_FULL=yes) of the clang
executable.

# 9771cac2 25-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a1aaa66b 20-Nov-2019 Dimitry Andric <dim@FreeBSD.org>

Add explanatory comments for the different SRCS_xxx variables used in
the Makefiles for libllvm and libclang. While here, cleanup a commented
out SRCS entry in libllvmminimal's Makefile.

MFC after: 3 days

# 23559b6a 24-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang including the static analyzer
(enabled via MK_CLANG_FULL).

# 4014a71f 23-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# efa75597 21-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update llvm and clang build glue to make MK_CLANG_EXTRAS=yes and
MK_CLANG_FULL=yes work.

# 5e86819c 20-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Add and remove sources from libllvm and libclang, to make the minimal
clang executable (with all options except targets off) build.

# 99be4f2a 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue for upstream r338536 import.

# 67b158f6 01-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build blue to make WITH_CLANG_EXTRAS and WITH_CLANG_FULL work.

# 9f6e9a9f 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Make the minimal clang executable build.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 44389c28 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Sort source file lists under lib/clang.

# ea68f99b 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make the full clang
executable build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# ddf95e2a 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Tell bsd.dep.mk which depend files to dinclude.

This allows the _SKIP_DEPEND optimization to work, avoiding reading
the files when not needed. It also fixes META_MODE incorrectly
reading these files when not needed.

Sponsored by: Dell EMC Isilon

# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 89cb50c9 30-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and update
build glue.


# 302affcb 29-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304149, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 482a8244 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update some more build glue. All llvm extras, lld and lldb should link now.

# 050e2df1 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add new objects to lib/clang/lib{llvm,clang} and usr.bin/clang for the
MK_CLANG_EXTRAS=yes case.

# 3762ddd9 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add some new objects to libclang for the MK_CLANG_FULL=yes case.

# 5897d2f0 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Initial update of clang/llvm build glue, for building just a minimal
clang executable.

# 2714e44c 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Fix some erroneous minimization in libclang.

# f1a29dd3 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb release_40 branch r292009. Also update
build glue.


# 24e2fe98 09-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb trunk r291476.


# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# bdd1243d 14-Apr-2023 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16-init-18548-gb0daacf58f41.

PR: 271047
MFC after: 1 month


# 4dc3b1fa 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

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

# d8ed7fa3 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed"

This reverts commit 8f391d9098083044793ff036dff8c96930fb1553. There are
still a bunch of problems, and apparently ${.ALLSRC} does not work as I
expected.

Fixes: 8f391d909808

# 8f391d90 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed

This flag ensures that the tblgen tools do not actually touch the
produced .inc file, if there are no changes to the contents. In turn,
this may prevent a number of rebuilds of files that include such .inc
files, saving build time.

While here, ensure that the shell invocations to locate the used tblgen
binary do not show unnecessary error messages.

Reported by: des
MFC after: 1 week

# ab80f0b2 25-Feb-2023 Dimitry Andric <dim@FreeBSD.org>

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

# 972a253a 27-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17826-g1f8ae9d7e7e4, the last commit before
the upstream release/16.x branch was created.

PR: 265425
MFC after: 2 weeks


# 753f127f 14-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR: 265425
MFC after: 2 weeks


# 81ad6265 04-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks


# 1838bd0f 05-Feb-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project release/14.x llvmorg-14-init-18315-g190be5457c90

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18315-g190be5457c90.

PR: 261742
MFC after: 2 weeks


# 04eeddc0 27-Jan-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR: 261742
MFC after: 2 weeks


# 4824e7fd 02-Dec-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-11187-g222442ec2d71

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-11187-g222442ec2d71.

PR: 261742
MFC after: 2 weeks


# 5e801ac6 20-Nov-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR: 261742
MFC after: 2 weeks


# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 20885331 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Put clang/lib/Tooling/Core/Replacement.cpp under SRCS_MIN, since it is
required by both the static analyzer (MK_CLANG_FULL) and clang-format
(MK_CLANG_FORMAT). We could also invent yet another SRCS variant, but
that seems a bit overkill.

# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 0a9ab9f5 24-Jun-2020 Conrad Meyer <cem@FreeBSD.org>

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT. Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D25427

# c357f7d2 26-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a full build (MK_CLANG_FULL=yes) of the clang
executable.

# 9771cac2 25-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a1aaa66b 20-Nov-2019 Dimitry Andric <dim@FreeBSD.org>

Add explanatory comments for the different SRCS_xxx variables used in
the Makefiles for libllvm and libclang. While here, cleanup a commented
out SRCS entry in libllvmminimal's Makefile.

MFC after: 3 days

# 23559b6a 24-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang including the static analyzer
(enabled via MK_CLANG_FULL).

# 4014a71f 23-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# efa75597 21-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update llvm and clang build glue to make MK_CLANG_EXTRAS=yes and
MK_CLANG_FULL=yes work.

# 5e86819c 20-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Add and remove sources from libllvm and libclang, to make the minimal
clang executable (with all options except targets off) build.

# 99be4f2a 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue for upstream r338536 import.

# 67b158f6 01-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build blue to make WITH_CLANG_EXTRAS and WITH_CLANG_FULL work.

# 9f6e9a9f 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Make the minimal clang executable build.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 44389c28 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Sort source file lists under lib/clang.

# ea68f99b 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make the full clang
executable build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# ddf95e2a 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Tell bsd.dep.mk which depend files to dinclude.

This allows the _SKIP_DEPEND optimization to work, avoiding reading
the files when not needed. It also fixes META_MODE incorrectly
reading these files when not needed.

Sponsored by: Dell EMC Isilon

# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 89cb50c9 30-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and update
build glue.


# 302affcb 29-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304149, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 482a8244 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update some more build glue. All llvm extras, lld and lldb should link now.

# 050e2df1 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add new objects to lib/clang/lib{llvm,clang} and usr.bin/clang for the
MK_CLANG_EXTRAS=yes case.

# 3762ddd9 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add some new objects to libclang for the MK_CLANG_FULL=yes case.

# 5897d2f0 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Initial update of clang/llvm build glue, for building just a minimal
clang executable.

# 2714e44c 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Fix some erroneous minimization in libclang.

# f1a29dd3 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb release_40 branch r292009. Also update
build glue.


# 24e2fe98 09-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb trunk r291476.


# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 4dc3b1fa 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

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


# d8ed7fa3 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Revert "Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed"

This reverts commit 8f391d9098083044793ff036dff8c96930fb1553. There are
still a bunch of problems, and apparently ${.ALLSRC} does not work as I
expected.

Fixes: 8f391d909808


# 8f391d90 29-Mar-2023 Dimitry Andric <dim@FreeBSD.org>

Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed

This flag ensures that the tblgen tools do not actually touch the
produced .inc file, if there are no changes to the contents. In turn,
this may prevent a number of rebuilds of files that include such .inc
files, saving build time.

While here, ensure that the shell invocations to locate the used tblgen
binary do not show unnecessary error messages.

Reported by: des
MFC after: 1 week


# ab80f0b2 25-Feb-2023 Dimitry Andric <dim@FreeBSD.org>

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


# 972a253a 27-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17826-g1f8ae9d7e7e4, the last commit before
the upstream release/16.x branch was created.

PR: 265425
MFC after: 2 weeks


# 753f127f 14-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR: 265425
MFC after: 2 weeks


# 81ad6265 04-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks


# 1838bd0f 05-Feb-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project release/14.x llvmorg-14-init-18315-g190be5457c90

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18315-g190be5457c90.

PR: 261742
MFC after: 2 weeks


# 04eeddc0 27-Jan-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR: 261742
MFC after: 2 weeks


# 4824e7fd 02-Dec-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-11187-g222442ec2d71

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-11187-g222442ec2d71.

PR: 261742
MFC after: 2 weeks


# 5e801ac6 20-Nov-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR: 261742
MFC after: 2 weeks


# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 20885331 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Put clang/lib/Tooling/Core/Replacement.cpp under SRCS_MIN, since it is
required by both the static analyzer (MK_CLANG_FULL) and clang-format
(MK_CLANG_FORMAT). We could also invent yet another SRCS variant, but
that seems a bit overkill.

# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 0a9ab9f5 24-Jun-2020 Conrad Meyer <cem@FreeBSD.org>

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT. Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D25427

# c357f7d2 26-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a full build (MK_CLANG_FULL=yes) of the clang
executable.

# 9771cac2 25-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a1aaa66b 20-Nov-2019 Dimitry Andric <dim@FreeBSD.org>

Add explanatory comments for the different SRCS_xxx variables used in
the Makefiles for libllvm and libclang. While here, cleanup a commented
out SRCS entry in libllvmminimal's Makefile.

MFC after: 3 days

# 23559b6a 24-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang including the static analyzer
(enabled via MK_CLANG_FULL).

# 4014a71f 23-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# efa75597 21-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update llvm and clang build glue to make MK_CLANG_EXTRAS=yes and
MK_CLANG_FULL=yes work.

# 5e86819c 20-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Add and remove sources from libllvm and libclang, to make the minimal
clang executable (with all options except targets off) build.

# 99be4f2a 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue for upstream r338536 import.

# 67b158f6 01-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build blue to make WITH_CLANG_EXTRAS and WITH_CLANG_FULL work.

# 9f6e9a9f 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Make the minimal clang executable build.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 44389c28 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Sort source file lists under lib/clang.

# ea68f99b 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make the full clang
executable build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# ddf95e2a 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Tell bsd.dep.mk which depend files to dinclude.

This allows the _SKIP_DEPEND optimization to work, avoiding reading
the files when not needed. It also fixes META_MODE incorrectly
reading these files when not needed.

Sponsored by: Dell EMC Isilon

# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 89cb50c9 30-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and update
build glue.


# 302affcb 29-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304149, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 482a8244 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update some more build glue. All llvm extras, lld and lldb should link now.

# 050e2df1 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add new objects to lib/clang/lib{llvm,clang} and usr.bin/clang for the
MK_CLANG_EXTRAS=yes case.

# 3762ddd9 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add some new objects to libclang for the MK_CLANG_FULL=yes case.

# 5897d2f0 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Initial update of clang/llvm build glue, for building just a minimal
clang executable.

# 2714e44c 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Fix some erroneous minimization in libclang.

# f1a29dd3 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb release_40 branch r292009. Also update
build glue.


# 24e2fe98 09-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb trunk r291476.


# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 1838bd0f 05-Feb-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project release/14.x llvmorg-14-init-18315-g190be5457c90

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18315-g190be5457c90.

PR: 261742
MFC after: 2 weeks


# 04eeddc0 27-Jan-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR: 261742
MFC after: 2 weeks


# 4824e7fd 02-Dec-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-11187-g222442ec2d71

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-11187-g222442ec2d71.

PR: 261742
MFC after: 2 weeks


# 5e801ac6 20-Nov-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR: 261742
MFC after: 2 weeks


# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 20885331 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Put clang/lib/Tooling/Core/Replacement.cpp under SRCS_MIN, since it is
required by both the static analyzer (MK_CLANG_FULL) and clang-format
(MK_CLANG_FORMAT). We could also invent yet another SRCS variant, but
that seems a bit overkill.

# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 0a9ab9f5 24-Jun-2020 Conrad Meyer <cem@FreeBSD.org>

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT. Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D25427

# c357f7d2 26-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a full build (MK_CLANG_FULL=yes) of the clang
executable.

# 9771cac2 25-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a1aaa66b 20-Nov-2019 Dimitry Andric <dim@FreeBSD.org>

Add explanatory comments for the different SRCS_xxx variables used in
the Makefiles for libllvm and libclang. While here, cleanup a commented
out SRCS entry in libllvmminimal's Makefile.

MFC after: 3 days

# 23559b6a 24-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang including the static analyzer
(enabled via MK_CLANG_FULL).

# 4014a71f 23-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# efa75597 21-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update llvm and clang build glue to make MK_CLANG_EXTRAS=yes and
MK_CLANG_FULL=yes work.

# 5e86819c 20-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Add and remove sources from libllvm and libclang, to make the minimal
clang executable (with all options except targets off) build.

# 99be4f2a 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue for upstream r338536 import.

# 67b158f6 01-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build blue to make WITH_CLANG_EXTRAS and WITH_CLANG_FULL work.

# 9f6e9a9f 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Make the minimal clang executable build.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 44389c28 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Sort source file lists under lib/clang.

# ea68f99b 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make the full clang
executable build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# ddf95e2a 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Tell bsd.dep.mk which depend files to dinclude.

This allows the _SKIP_DEPEND optimization to work, avoiding reading
the files when not needed. It also fixes META_MODE incorrectly
reading these files when not needed.

Sponsored by: Dell EMC Isilon

# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 89cb50c9 30-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and update
build glue.


# 302affcb 29-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304149, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 482a8244 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update some more build glue. All llvm extras, lld and lldb should link now.

# 050e2df1 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add new objects to lib/clang/lib{llvm,clang} and usr.bin/clang for the
MK_CLANG_EXTRAS=yes case.

# 3762ddd9 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add some new objects to libclang for the MK_CLANG_FULL=yes case.

# 5897d2f0 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Initial update of clang/llvm build glue, for building just a minimal
clang executable.

# 2714e44c 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Fix some erroneous minimization in libclang.

# f1a29dd3 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb release_40 branch r292009. Also update
build glue.


# 24e2fe98 09-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb trunk r291476.


# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# fe6060f1 22-Aug-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR: 258209
MFC after: 2 weeks


# e8d8bef9 13-Jun-2021 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks


# 20885331 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Put clang/lib/Tooling/Core/Replacement.cpp under SRCS_MIN, since it is
required by both the static analyzer (MK_CLANG_FULL) and clang-format
(MK_CLANG_FORMAT). We could also invent yet another SRCS variant, but
that seems a bit overkill.

# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.

# 0a9ab9f5 24-Jun-2020 Conrad Meyer <cem@FreeBSD.org>

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT. Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D25427

# c357f7d2 26-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a full build (MK_CLANG_FULL=yes) of the clang
executable.

# 9771cac2 25-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

# a1aaa66b 20-Nov-2019 Dimitry Andric <dim@FreeBSD.org>

Add explanatory comments for the different SRCS_xxx variables used in
the Makefiles for libllvm and libclang. While here, cleanup a commented
out SRCS entry in libllvmminimal's Makefile.

MFC after: 3 days

# 23559b6a 24-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang including the static analyzer
(enabled via MK_CLANG_FULL).

# 4014a71f 23-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.

# efa75597 21-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update llvm and clang build glue to make MK_CLANG_EXTRAS=yes and
MK_CLANG_FULL=yes work.

# 5e86819c 20-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Add and remove sources from libllvm and libclang, to make the minimal
clang executable (with all options except targets off) build.

# 99be4f2a 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue for upstream r338536 import.

# 67b158f6 01-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build blue to make WITH_CLANG_EXTRAS and WITH_CLANG_FULL work.

# 9f6e9a9f 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Make the minimal clang executable build.

# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.

# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.

# 44389c28 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Sort source file lists under lib/clang.

# ea68f99b 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make the full clang
executable build.

# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.

# ddf95e2a 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Tell bsd.dep.mk which depend files to dinclude.

This allows the _SKIP_DEPEND optimization to work, avoiding reading
the files when not needed. It also fixes META_MODE incorrectly
reading these files when not needed.

Sponsored by: Dell EMC Isilon

# edd7eadd 27-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.


# 4198293b 16-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r319801 through r320041.


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days

# 89cb50c9 30-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and update
build glue.


# 302affcb 29-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304149, and update
build glue.


# f37b6182 03-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.

# 482a8244 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update some more build glue. All llvm extras, lld and lldb should link now.

# 050e2df1 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add new objects to lib/clang/lib{llvm,clang} and usr.bin/clang for the
MK_CLANG_EXTRAS=yes case.

# 3762ddd9 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add some new objects to libclang for the MK_CLANG_FULL=yes case.

# 5897d2f0 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Initial update of clang/llvm build glue, for building just a minimal
clang executable.

# 2714e44c 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Fix some erroneous minimization in libclang.

# f1a29dd3 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb release_40 branch r292009. Also update
build glue.


# 24e2fe98 09-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge llvm, clang, lld and lldb trunk r291476.


# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.

# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 20885331 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Put clang/lib/Tooling/Core/Replacement.cpp under SRCS_MIN, since it is
required by both the static analyzer (MK_CLANG_FULL) and clang-format
(MK_CLANG_FORMAT). We could also invent yet another SRCS variant, but
that seems a bit overkill.


# 48aaf27b 06-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

Update Makefiles under lib/clang and usr.bin/clang for 11.0.0 builds,
and also bump the version in the mtree files.


# 0a9ab9f5 24-Jun-2020 Conrad Meyer <cem@FreeBSD.org>

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT. Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D25427


# c357f7d2 26-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a full build (MK_CLANG_FULL=yes) of the clang
executable.


# 9771cac2 25-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.


# 0b57cec5 20-Dec-2019 Dimitry Andric <dim@FreeBSD.org>

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.


# a1aaa66b 20-Nov-2019 Dimitry Andric <dim@FreeBSD.org>

Add explanatory comments for the different SRCS_xxx variables used in
the Makefiles for libllvm and libclang. While here, cleanup a commented
out SRCS entry in libllvmminimal's Makefile.

MFC after: 3 days


# 23559b6a 24-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang including the static analyzer
(enabled via MK_CLANG_FULL).


# 4014a71f 23-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a minimal build of the clang executable.


# efa75597 21-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Update llvm and clang build glue to make MK_CLANG_EXTRAS=yes and
MK_CLANG_FULL=yes work.


# 5e86819c 20-Jan-2019 Dimitry Andric <dim@FreeBSD.org>

Add and remove sources from libllvm and libclang, to make the minimal
clang executable (with all options except targets off) build.


# 99be4f2a 02-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build glue for upstream r338536 import.


# 67b158f6 01-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Update build blue to make WITH_CLANG_EXTRAS and WITH_CLANG_FULL work.


# 9f6e9a9f 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Make the minimal clang executable build.


# d1efe516 31-Jul-2018 Dimitry Andric <dim@FreeBSD.org>

Remove SRCS for files that have been deleted upstream.


# 77b0be52 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make lldb build.


# 44389c28 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Sort source file lists under lib/clang.


# ea68f99b 22-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Next step in updating llvm/clang build glue: make the full clang
executable build.


# 36cb3905 21-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

First step in updating llvm/clang build glue: make only the clang
executable build.


# ddf95e2a 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Tell bsd.dep.mk which depend files to dinclude.

This allows the _SKIP_DEPEND optimization to work, avoiding reading
the files when not needed. It also fixes META_MODE incorrectly
reading these files when not needed.

Sponsored by: Dell EMC Isilon


# 5c4e2ac4 13-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>


# 834210fa 10-Jun-2017 Dimitry Andric <dim@FreeBSD.org>

Remove a few unneeded files from libllvm, libclang and liblldb.

MFC after: 3 days


# b33474c8 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Strip out a few objects from libclang, liblldb and lldb, which are not
referenced due to the selection of tools that we build, and our compile
time options.


# 482a8244 21-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Update some more build glue. All llvm extras, lld and lldb should link now.


# 050e2df1 18-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add new objects to lib/clang/lib{llvm,clang} and usr.bin/clang for the
MK_CLANG_EXTRAS=yes case.


# 3762ddd9 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Add some new objects to libclang for the MK_CLANG_FULL=yes case.


# 5897d2f0 17-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Initial update of clang/llvm build glue, for building just a minimal
clang executable.


# 2714e44c 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Fix some erroneous minimization in libclang.


# 09bfd043 03-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Initial updates to llvm/clang build glue.


# e1cd7682 27-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.


# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.