[PATCH] D66823: [08/10] [WindowsResource] Remove use of global variables in WindowsResourceParser

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 12:14:36 PDT 2019


mstorsjo created this revision.
mstorsjo added reviewers: thakis, rnk, ruiu.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

Instead of updating a global variable counter for the next index of strings and data blobs, pass along a reference to actual string vector and let the TreeNode insertion methods add their strings to the vector when a new entry is needed. For data, pass in the expected index but keep the insertion outside of the tree insertion methods (needed by a later patch, for reusing an old slot in the data vector).

Additionally, if the resource tree had duplicates, that were ignored with -force:multipleres in lld, we no longer store all versions of the duplicated resource data, now we only keep the one that actually ends up referenced.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66823

Files:
  llvm/include/llvm/Object/WindowsResource.h
  llvm/lib/Object/WindowsResource.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66823.217471.patch
Type: text/x-patch
Size: 10491 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190827/adc58c4d/attachment.bin>


More information about the llvm-commits mailing list