diff options
author | Martin Storsjo <martin@martin.st> | 2019-08-30 06:55:54 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2019-08-30 06:55:54 +0000 |
commit | e62d5682fb31285d836d97bbe35fc3b64a248d58 (patch) | |
tree | 0be2d9bff7054b544117ef41aae7a09a5ecb81de /llvm/lib/Object/WindowsResource.cpp | |
parent | 9438221785b110a3371cabccd47ac9887666ea35 (diff) | |
download | llvm-e62d5682fb31285d836d97bbe35fc3b64a248d58.zip llvm-e62d5682fb31285d836d97bbe35fc3b64a248d58.tar.gz llvm-e62d5682fb31285d836d97bbe35fc3b64a248d58.tar.bz2 |
[WindowsResource] Avoid duplicating the input filenames for each resource. NFC.
Differential Revision: https://reviews.llvm.org/D66821
llvm-svn: 370434
Diffstat (limited to 'llvm/lib/Object/WindowsResource.cpp')
-rw-r--r-- | llvm/lib/Object/WindowsResource.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Object/WindowsResource.cpp b/llvm/lib/Object/WindowsResource.cpp index 762e8bc..5b09ce3 100644 --- a/llvm/lib/Object/WindowsResource.cpp +++ b/llvm/lib/Object/WindowsResource.cpp @@ -219,6 +219,8 @@ Error WindowsResourceParser::parse(WindowsResource *WR, } 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 @@ Error WindowsResourceParser::parse(WindowsResource *WR, 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())); |