[all-commits] [llvm/llvm-project] 6f4151: [llvm-rc] Accept filenames provided as multiple st...
Martin Storsjö via All-commits
all-commits at lists.llvm.org
Mon Oct 16 13:16:38 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6f41510d4f4848ca4dde203d24bae26587be1f8c
https://github.com/llvm/llvm-project/commit/6f41510d4f4848ca4dde203d24bae26587be1f8c
Author: Martin Storsjö <martin at martin.st>
Date: 2023-10-16 (Mon, 16 Oct 2023)
Changed paths:
A llvm/test/tools/llvm-rc/Inputs/split-path.rc
A llvm/test/tools/llvm-rc/split-path.test
M llvm/tools/llvm-rc/ResourceScriptParser.cpp
M llvm/tools/llvm-rc/ResourceScriptParser.h
Log Message:
-----------
[llvm-rc] Accept filenames provided as multiple string literals (#68881)
GNU windres supports this, while MS rc.exe doesn't.
MS rc.exe only supports treating consecutive string literals as if they
were fused into one in a few fixed locations (most of which are already
supported), while GNU windres supports this essentially anywhere in any
string. See
b989fcbae6f179ad887d19ceef83ace1c00b87cc for one recent change that
extended support for this in one specific resource.
A reasonable use case for multiple concatenated string literals that GNU
windres accepts is `1 ICON DIR "/name.ico"`, where the directory is
provided via the preprocessor, expanding to another string literal; this
is https://github.com/llvm/llvm-project/issues/51286.
Extend the parser to try to consume all consecutive string tokens,
whenever reading a filename. Adjust the handling of user data resources
read from a file to use the readFilename() helper.
While this probably doesn't cover every single case where GNU windres
might accept concatenated string literals, this is the primary missing
case that has been reported so far.
More information about the All-commits
mailing list