[PATCH] D34525: Replace trivial use of external rc.exe by writing our own .res file.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 08:44:02 PDT 2017


ruiu added a comment.

Looks much better. A few minor comments.



================
Comment at: llvm/include/llvm/Object/WindowsResource.h:70
+  void setType(uint16_t ID) {
+    TypeFlag = 0xffff;
+    TypeID = ID;
----------------
Instead of defining setType and setName, you can just set TypeFlag and NameID to 0xffff in writeResEntryHeader, no?


================
Comment at: llvm/lib/BinaryFormat/Magic.cpp:54
     // Windows resource file
-    if (startswith(Magic, "\0\0\0\0\x20\0\0\0\xFF"))
+    if (memcmp(Magic.data(), COFF::WinResMagic, sizeof(COFF::WinResMagic)) == 0)
       return file_magic::windows_resource;
----------------
You want to make sure that Magic.data() is at least the same size as WinResMagic.


https://reviews.llvm.org/D34525





More information about the llvm-commits mailing list