[PATCH] D100755: [llvm-rc] [3/4] Run clang to preprocess input files

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 20 08:35:23 PDT 2021


thakis accepted this revision.
thakis added a comment.
This revision is now accepted and ready to land.

This looks basically good to me.



================
Comment at: llvm/tools/llvm-rc/llvm-rc.cpp:98
+  if (!Parent.empty())
+    Path = sys::findProgramByName("clang", Parent);
+  if (!Path)
----------------
if there's no clang but only clang-cl, it should try to find that. (pass --driver-mode=gcc to use only one set of options – but see below)

(we don't bundle clang on windows in chromium, only clang-cl. we don't currently use llvm-rc, but we might one day)


================
Comment at: llvm/tools/llvm-rc/llvm-rc.cpp:154
+      Args.push_back("-U");
+      break;
+    }
----------------
Here's our chromium wrapper: https://source.chromium.org/chromium/chromium/src/+/master:build/toolchain/win/rc/rc.py

On Windows, /winsysroot support and possibly -imsvc support would be nice too.


================
Comment at: llvm/tools/llvm-rc/llvm-rc.cpp:206
+  std::string PreprocessedFile = InArgsInfo[0];
+  if (!InputArgs.hasArg(OPT_no_cpp) && !getenv("LLVM_RC_NO_CPP")) {
+    std::string OutFile = createTempFile("preproc", "rc");
----------------
Do we need the env var?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100755



More information about the llvm-commits mailing list