This is an archive of the discontinued LLVM Phabricator instance.

[llvm-rc] Add support for parsing memory flags
ClosedPublic

Authored by mstorsjo on May 14 2018, 1:12 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.May 14 2018, 1:12 AM

I kinda wish the test was broken up a bit. The stringtable bundle logic is distinctly different than just applying the keywords to other resource types, so that would be a natural place to break this apart.

The changes themselves seem correct.

thakis accepted this revision.May 14 2018, 12:50 PM

lgtm.

This revision is now accepted and ready to land.May 14 2018, 12:50 PM
mstorsjo updated this revision to Diff 146682.May 14 2018, 1:58 PM

Split the tests into two files.

I kinda wish the test was broken up a bit. The stringtable bundle logic is distinctly different than just applying the keywords to other resource types, so that would be a natural place to break this apart.

Done.

amccarth accepted this revision.May 14 2018, 2:32 PM

Thanks for splitting the test.

This revision was automatically updated to reflect the committed changes.