aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-rc/llvm-rc.cpp
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2023-12-15 20:15:07 +0200
committerGitHub <noreply@github.com>2023-12-15 20:15:07 +0200
commit10b78cc8cea65e7e77d227af4027963f39402724 (patch)
tree6aa41d5b054c0228b427b0a85d1180a46e6a23f3 /llvm/tools/llvm-rc/llvm-rc.cpp
parent7dcd8ef135147de1576c2863b963ec929a15e8cb (diff)
downloadllvm-10b78cc8cea65e7e77d227af4027963f39402724.zip
llvm-10b78cc8cea65e7e77d227af4027963f39402724.tar.gz
llvm-10b78cc8cea65e7e77d227af4027963f39402724.tar.bz2
[llvm-windres] Pass user preprocessor arguments before the input filename (#75389)
If passing the windres option --preprocessor, the default arguments "-E -xc -DRC_INVOKED" aren't passed. If these are passed explicitly by the user via --preprocessor-arg instead, we need to make sure that "-xc" is passed before the input filename, as this compiler/preprocessor option only has an effect on input files that follow it. This fixes one of the issues with llvm-windres observed in https://github.com/msys2/MINGW-packages/pull/19157.
Diffstat (limited to 'llvm/tools/llvm-rc/llvm-rc.cpp')
-rw-r--r--llvm/tools/llvm-rc/llvm-rc.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-rc/llvm-rc.cpp b/llvm/tools/llvm-rc/llvm-rc.cpp
index b955347f..4375697 100644
--- a/llvm/tools/llvm-rc/llvm-rc.cpp
+++ b/llvm/tools/llvm-rc/llvm-rc.cpp
@@ -253,11 +253,11 @@ void preprocess(StringRef Src, StringRef Dst, const RcOptions &Opts,
for (const auto &S : Opts.PreprocessCmd)
Args.push_back(S);
}
+ for (const auto &S : Opts.PreprocessArgs)
+ Args.push_back(S);
Args.push_back(Src);
Args.push_back("-o");
Args.push_back(Dst);
- for (const auto &S : Opts.PreprocessArgs)
- Args.push_back(S);
if (Opts.PrintCmdAndExit || Opts.BeVerbose) {
for (const auto &A : Args) {
outs() << " ";