[PATCH] D146352: Split out `llvm-cg-tblgen` from `llvm-tblgen`

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 18 15:22:02 PDT 2023


mstorsjo added inline comments.


================
Comment at: llvm/utils/TableGen/CMakeLists.txt:68
+
+add_tablegen(llvm-tblgen LLVM
+  DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
----------------
I think there's a bit of conflict here, when you're calling `add_tablegen` twice with `project` set to `LLVM`.

This parameter is used for setting up the `${project}_TABLEGEN` variable, which allows the user to specify a path to an existing such binary when e.g. cross compiling, instead of building a new one - see e.g. https://github.com/llvm/llvm-project/blob/llvmorg-16.0.0/llvm/cmake/modules/TableGen.cmake#L156-L169.

Currently, this can be set via `LLVM_TABLEGEN`, `CLANG_TABLEGEN` etc. I'm not sure if we should rename the `project` parameter there - I think it might work by passing `LLVM_CG` for that parameter for the new executable, making `LLVM_CG_TABLEGEN`.

For easier use, one can implicitly set `LLVM_NATIVE_TOOL_DIR=<directory>` these days, pointing at a directory containing all these `*-tblgen` binaries. But despite this, the individual setting variables kinda need to work too (and I'm afraid this current form, with clashing options, might cause trouble in build configs where that variable is used, e.g. when cross compiling LLVM).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146352/new/

https://reviews.llvm.org/D146352



More information about the llvm-commits mailing list