[PATCH] D46636: [llvm-rc] Add support for the RCDATA resource type

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 11:24:39 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL331902: [llvm-rc] Add support for the RCDATA resource type (authored by mstorsjo, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D46636?vs=145896&id=145966#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D46636

Files:
  llvm/trunk/test/tools/llvm-rc/Inputs/tag-user.rc
  llvm/trunk/test/tools/llvm-rc/tag-user.test
  llvm/trunk/tools/llvm-rc/ResourceScriptParser.cpp
  llvm/trunk/tools/llvm-rc/ResourceScriptStmt.h


Index: llvm/trunk/tools/llvm-rc/ResourceScriptStmt.h
===================================================================
--- llvm/trunk/tools/llvm-rc/ResourceScriptStmt.h
+++ llvm/trunk/tools/llvm-rc/ResourceScriptStmt.h
@@ -127,6 +127,7 @@
   RkDialog = 5,
   RkStringTableBundle = 6,
   RkAccelerators = 9,
+  RkRcData = 10,
   RkCursorGroup = 12,
   RkIconGroup = 14,
   RkVersionInfo = 16,
Index: llvm/trunk/tools/llvm-rc/ResourceScriptParser.cpp
===================================================================
--- llvm/trunk/tools/llvm-rc/ResourceScriptParser.cpp
+++ llvm/trunk/tools/llvm-rc/ResourceScriptParser.cpp
@@ -80,6 +80,8 @@
     Result = parseIconResource();
   else if (TypeToken->equalsLower("MENU"))
     Result = parseMenuResource();
+  else if (TypeToken->equalsLower("RCDATA"))
+    Result = parseUserDefinedResource(RkRcData);
   else if (TypeToken->equalsLower("VERSIONINFO"))
     Result = parseVersionInfoResource();
   else
Index: llvm/trunk/test/tools/llvm-rc/tag-user.test
===================================================================
--- llvm/trunk/test/tools/llvm-rc/tag-user.test
+++ llvm/trunk/test/tools/llvm-rc/tag-user.test
@@ -20,6 +20,21 @@
 ; CHECK-NEXT:   0020: CDAB01EF CDAB                        |......|
 ; CHECK-NEXT: )
 
+; CHECK-DAG:  Resource type (int): 10
+; CHECK-NEXT: Resource name (int): 501
+; CHECK-NEXT: Data version: 0
+; CHECK-NEXT: Memory flags: 0x30
+; CHECK-NEXT: Language ID: 1033
+; CHECK-NEXT: Version (major): 0
+; CHECK-NEXT: Version (minor): 0
+; CHECK-NEXT: Characteristics: 0
+; CHECK-NEXT: Data size: 38
+; CHECK-NEXT: Data: (
+; CHECK-NEXT:   0000: 01000200 03000400 05006461 74617700  |..........dataw.|
+; CHECK-NEXT:   0010: 69006400 65002000 64006100 74006100  |i.d.e. .d.a.t.a.|
+; CHECK-NEXT:   0020: CDAB01EF CDAB                        |......|
+; CHECK-NEXT: )
+
 ; CHECK-DAG:  Resource type (string): NAME2
 ; CHECK-NEXT: Resource name (string): NAME1
 ; CHECK-NEXT: Data version: 0
Index: llvm/trunk/test/tools/llvm-rc/Inputs/tag-user.rc
===================================================================
--- llvm/trunk/test/tools/llvm-rc/Inputs/tag-user.rc
+++ llvm/trunk/test/tools/llvm-rc/Inputs/tag-user.rc
@@ -1,6 +1,9 @@
 500 500 {
   1, 2, 3, 4, 5, "data", L"wide data", 0xABCD, 0xABCDEF01L
 }
+501 RCDATA {
+  1, 2, 3, 4, 5, "data", L"wide data", 0xABCD, 0xABCDEF01L
+}
 
 NAME1 NAME2 {}
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46636.145966.patch
Type: text/x-patch
Size: 2393 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180509/339d604b/attachment.bin>


More information about the llvm-commits mailing list