LLVM/project 27f3002llvm/utils/TableGen DirectiveEmitter.cpp IntrinsicEmitter.cpp, llvm/utils/TableGen/Basic DirectiveEmitter.cpp IntrinsicEmitter.cpp

[llvm-(min-)tblgen] Avoid redundant source compilation (#114494)

All the sources of `llvm-min-tblgen` are also used for `llvm-tblgen`,
with identical compilation flags. Reuse the object files of
`llvm-min-tblgen` for `llvm-tblgen` by applying the usual source
structure of an executable: One file per executable which named after
the executable name containing the (in this case trivial) main function,
which just calls the tblgen_main in TableGen.cpp. This should also clear
up any confusion (including mine) of where each executable's main
function is.

While this slightly reduces build time, the main motivation is ccache.
Using the hard_link
option, building the object files for `llvm-tblgen` will result in a
hard link to the same object file already used for `llvm-min-tblgen`. To
signal the build system that the file is new, ccache will update the
file's time stamp. Unfortunately, time stamps are shared between all
hard-linked files s.t. this will indirectly also update the time stamps
for the object files used for `llvm-tblgen`. At the next run, Ninja will

    [9 lines not shown]
DeltaFile
+0-1,225llvm/utils/TableGen/DirectiveEmitter.cpp
+1,225-0llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
+0-867llvm/utils/TableGen/IntrinsicEmitter.cpp
+867-0llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp
+362-0llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
+0-362llvm/utils/TableGen/ARMTargetDefEmitter.cpp
+2,454-2,45413 files not shown
+3,248-3,19519 files

LLVM/project 06b6161llvm/utils/TableGen DirectiveEmitter.cpp IntrinsicEmitter.cpp, llvm/utils/TableGen/Basic DirectiveEmitter.cpp IntrinsicEmitter.cpp

Revert "[llvm-(min-)tblgen] Avoid redundant source compilation (#114494)"

This reverts commit f6cb56902c6dcafede21eb6662910b6ff661fc0f.

Buildbot failures such as https://lab.llvm.org/buildbot/#/builders/89/builds/13541:
```
/usr/bin/ld: utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o: undefined reference to symbol '_ZN4llvm23EnableABIBreakingChecksE'
/usr/bin/ld: /home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/./lib/libLLVMSupport.so.20.0git: error adding symbols: DSO missing from command line
```

Going to investigate.
DeltaFile
+1,225-0llvm/utils/TableGen/DirectiveEmitter.cpp
+0-1,225llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
+867-0llvm/utils/TableGen/IntrinsicEmitter.cpp
+0-867llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp
+362-0llvm/utils/TableGen/ARMTargetDefEmitter.cpp
+0-362llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
+2,454-2,45413 files not shown
+3,197-3,24819 files

LLVM/project 1557818llvm/utils/TableGen DirectiveEmitter.cpp IntrinsicEmitter.cpp, llvm/utils/TableGen/Basic DirectiveEmitter.cpp IntrinsicEmitter.cpp

Revert "[llvm-(min-)tblgen] Avoid redundant source compilation (#114494)"

This reverts commit f6cb56902c6dcafede21eb6662910b6ff661fc0f.
DeltaFile
+0-1,225llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
+1,225-0llvm/utils/TableGen/DirectiveEmitter.cpp
+0-867llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp
+867-0llvm/utils/TableGen/IntrinsicEmitter.cpp
+0-362llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
+362-0llvm/utils/TableGen/ARMTargetDefEmitter.cpp
+2,454-2,45413 files not shown
+3,197-3,24819 files

LLVM/project f6cb569llvm/utils/TableGen DirectiveEmitter.cpp IntrinsicEmitter.cpp, llvm/utils/TableGen/Basic DirectiveEmitter.cpp IntrinsicEmitter.cpp

[llvm-(min-)tblgen] Avoid redundant source compilation (#114494)

All the sources of `llvm-min-tblgen` are also used for `llvm-tblgen`,
with identical compilation flags. Reuse the object files of
`llvm-min-tblgen` for `llvm-tblgen` by applying the usual source
structure of an executable: One file per executable which named after
the executable name containing the (in this case trivial) main function,
which just calls the tblgen_main in TableGen.cpp. This should also clear
up any confusion (including mine) of where each executable's main
function is.

While this slightly reduces build time, the main motivation is ccache.
Using the hard_link
option, building the object files for `llvm-tblgen` will result in a
hard link to the same object file already used for `llvm-min-tblgen`. To
signal the build system that the file is new, ccache will update the
file's time stamp. Unfortunately, time stamps are shared between all
hard-linked files s.t. this will indirectly also update the time stamps
for the object files used for `llvm-tblgen`. At the next run, Ninja will

    [8 lines not shown]
DeltaFile
+1,225-0llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
+0-1,225llvm/utils/TableGen/DirectiveEmitter.cpp
+0-867llvm/utils/TableGen/IntrinsicEmitter.cpp
+867-0llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp
+362-0llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
+0-362llvm/utils/TableGen/ARMTargetDefEmitter.cpp
+2,454-2,45413 files not shown
+3,248-3,19719 files