[PATCH] D46818: [llvm-rc] Add support for parsing memory flags

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 01:12:49 PDT 2018


mstorsjo created this revision.
mstorsjo added reviewers: zturner, amccarth, thakis.

Most of the handling is pretty straightforward; fetch the default memory flags for the specific resource type before parsing the flags and apply them on top of that, except that some flags imply others and some flags clear more than one flag.

For icons and cursors, the flags set get passed on to all individual single icon/cursor resources, while only some flags affect the icon/cursor group resource.

For stringtables, the behaviour is pretty simple; the first stringtable resource of a bundle sets the flags for the whole bundle.

The output of this test matches rc.exe byte for byte.

The actual use of these memory flags is deprecated and they have no effect since Win16, but some resource script files may still happen to have them in place.

Alternatively, if the code churn this induces doesn't seem to be worthwhile for a feature that doesn't really exist, we could just add dummy no-op parsing of the keywords.


Repository:
  rL LLVM

https://reviews.llvm.org/D46818

Files:
  test/tools/llvm-rc/Inputs/memoryflags.rc
  test/tools/llvm-rc/memoryflags.test
  tools/llvm-rc/ResourceFileWriter.cpp
  tools/llvm-rc/ResourceFileWriter.h
  tools/llvm-rc/ResourceScriptParser.cpp
  tools/llvm-rc/ResourceScriptParser.h
  tools/llvm-rc/ResourceScriptStmt.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46818.146548.patch
Type: text/x-patch
Size: 34216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180514/a69c2466/attachment-0001.bin>


More information about the llvm-commits mailing list