[PATCH] D66821: [07/10] [WindowsResource] Avoid duplicating the input filenames for each resource. NFC.
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 29 23:58:33 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370434: [WindowsResource] Avoid duplicating the input filenames for each resource. NFC. (authored by mstorsjo, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D66821?vs=217469&id=218028#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66821/new/
https://reviews.llvm.org/D66821
Files:
llvm/trunk/lib/Object/WindowsResource.cpp
Index: llvm/trunk/lib/Object/WindowsResource.cpp
===================================================================
--- llvm/trunk/lib/Object/WindowsResource.cpp
+++ llvm/trunk/lib/Object/WindowsResource.cpp
@@ -219,6 +219,8 @@
}
ResourceEntryRef Entry = EntryOrErr.get();
+ uint32_t Origin = InputFilenames.size();
+ InputFilenames.push_back(WR->getFileName());
bool End = false;
while (!End) {
Data.push_back(Entry.getData());
@@ -226,10 +228,9 @@
bool IsNewTypeString = false;
bool IsNewNameString = false;
- TreeNode* Node;
- bool IsNewNode = Root.addEntry(Entry, InputFilenames.size(),
- IsNewTypeString, IsNewNameString, Node);
- InputFilenames.push_back(WR->getFileName());
+ TreeNode *Node;
+ bool IsNewNode =
+ Root.addEntry(Entry, Origin, IsNewTypeString, IsNewNameString, Node);
if (!IsNewNode) {
Duplicates.push_back(makeDuplicateResourceError(
Entry, InputFilenames[Node->Origin], WR->getFileName()));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66821.218028.patch
Type: text/x-patch
Size: 1028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190830/4e4ce3c7/attachment.bin>
More information about the llvm-commits
mailing list