summaryrefslogtreecommitdiff
path: root/tools/llvm-rc/ResourceScriptParser.h
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-05-15 06:35:29 +0000
committerMartin Storsjo <martin@martin.st>2018-05-15 06:35:29 +0000
commit370633f2f2dd08a52252ac2c5f476651a51d65a7 (patch)
treec8e4273bd497ab269a22d6df1da6323f159be78a /tools/llvm-rc/ResourceScriptParser.h
parentce6387468a38f78864c8874b71b051c959a7db36 (diff)
[llvm-rc] Add support for parsing memory flags
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 these tests match 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. Differential Revision: https://reviews.llvm.org/D46818 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-rc/ResourceScriptParser.h')
-rw-r--r--tools/llvm-rc/ResourceScriptParser.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/llvm-rc/ResourceScriptParser.h b/tools/llvm-rc/ResourceScriptParser.h
index 639ef63863c..8e3cc55499e 100644
--- a/tools/llvm-rc/ResourceScriptParser.h
+++ b/tools/llvm-rc/ResourceScriptParser.h
@@ -129,6 +129,8 @@ private:
// msdn.microsoft.com/en-us/library/windows/desktop/aa381002(v=vs.85).aspx
enum class OptStmtType { BasicStmt, DialogStmt, DialogExStmt };
+ uint16_t parseMemoryFlags(uint16_t DefaultFlags);
+
Expected<OptionalStmtList>
parseOptionalStatements(OptStmtType StmtsType = OptStmtType::BasicStmt);