[PATCH] D73044: {tablegen] Emit string literals instead of char arrays

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 09:39:59 PST 2020


mstorsjo added inline comments.


================
Comment at: utils/TableGen/CMakeLists.txt:64
+# [1] https://docs.microsoft.com/en-us/cpp/cpp/compiler-limits?view=vs-2017
+if (NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
+  set(TABLEGEN_EMIT_LONG_STR_LITERALS ON)
----------------
I'm afraid this isn't sufficient; I normally first do a fully native build, then when crosscompiling, I point it at the already built fully native tblgen.

Also likewise if I don't have an already built tblgen when crosscompiling, cmake is invoked a second time recursively for building these tools, and I'd guess `CMAKE_CROSSCOMPILING` isn't set there, as it's a normal native build for those tools.

I think the one safe way of handling it would be to add a runtime option to tblgen for making msvc compatible output, and set that when generating tables, if the target compiler is msvc. Then it should work the same with any combination of build configurations. I don't know the tblgen internals if this is doable or what it looks like wrt the tblgen invocations in cmake though...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73044





More information about the llvm-commits mailing list