[PATCH] D55028: [gn build] Add template for running llvm-tblgen and use it to add build file for llvm/lib/IR.

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 28 23:37:33 PST 2018


phosek added inline comments.


================
Comment at: llvm/utils/gn/build/run_tablegen.py:8
+# Prefix with ./ to run built binary, not arbitrary stuff from PATH.
+sys.exit(subprocess.call(['./' + sys.argv[1]] + sys.argv[2:]))
----------------
[Chromium version](https://chromium.googlesource.com/chromium/src/+/master/build/gn_run_binary.py#23) does more fancy error checking on Windows, shall we do the same?


================
Comment at: llvm/utils/gn/secondary/llvm/utils/TableGen/tablegen.gni:27
+
+template("tablegen") {
+  assert(defined(invoker.args), "args must be defined for $target_name")
----------------
Have you considered copying Chromium's [`compiled_action.gni`](https://chromium.googlesource.com/chromium/src/+/master/build/compiled_action.gni) and then implementing `tablegen` in terms of that? It seems generally useful as I suspect you'll need the same functionality for Clang tablegen as well in the future.


================
Comment at: llvm/utils/gn/secondary/llvm/utils/TableGen/tablegen.gni:37
+  action(target_name) {
+    forward_variables_from(invoker, [ "visibility" ])
+
----------------
You should probably forward `testonly` as well`.


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

https://reviews.llvm.org/D55028





More information about the llvm-commits mailing list