[PATCH] D33566: Adding parsing ability for .res file, building the resource directory tree

Eric Beckmann via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 26 17:51:14 PDT 2017


ecbeckmann added inline comments.


================
Comment at: llvm/include/llvm/Object/WindowsResource.h:179
+  private:
+    uint16_t ID;
+    std::vector<UTF16> Name;
----------------
zturner wrote:
> ecbeckmann wrote:
> > zturner wrote:
> > > Can you do an inline initialization here?  `uint16_t ID = 0xFFFF;`
> > What is the purpose of this initialization?  We only ever check the ID if it is in the IDChildren list, and before adding to this list we always give the ID that was written in the .res file.
> You were already initializing it in the constructor to -1, but the initialization was repeated each time there was a new overload of the constructor.  If you initialize it this way, it's functionally equivalent to the code you had before, but you're just not repeating the specification of the value -1.
Ah okay.  I actually decided we don't really need to initialize the numeric ID.


https://reviews.llvm.org/D33566





More information about the llvm-commits mailing list