[PATCH] D28088: MetadataLoader: simplify old type ref upgrade by removing a redundant set (NFC)
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 23 22:18:09 PST 2016
mehdi_amini created this revision.
mehdi_amini added reviewers: pcc, dexonsmith.
mehdi_amini added a subscriber: llvm-commits.
I'm still trying to understand the logic, hopefully this is correct
(at least the validation is still passing).
https://reviews.llvm.org/D28088
Files:
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
Index: llvm/lib/Bitcode/Reader/MetadataLoader.cpp
===================================================================
--- llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -120,7 +120,6 @@
struct {
SmallDenseMap<MDString *, TempMDTuple, 1> Unknown;
SmallDenseMap<MDString *, DICompositeType *, 1> Final;
- SmallDenseMap<MDString *, DICompositeType *, 1> FwdDecls;
SmallVector<std::pair<TrackingMDRef, TempMDTuple>, 1> Arrays;
} OldTypeRefs;
@@ -246,11 +245,6 @@
bool DidReplaceTypeRefs = false;
- // Give up on finding a full definition for any forward decls that remain.
- for (const auto &Ref : OldTypeRefs.FwdDecls)
- OldTypeRefs.Final.insert(Ref);
- OldTypeRefs.FwdDecls.clear();
-
// Upgrade from old type ref arrays. In strange cases, this could add to
// OldTypeRefs.Unknown.
for (const auto &Array : OldTypeRefs.Arrays) {
@@ -302,10 +296,7 @@
void BitcodeReaderMetadataList::addTypeRef(MDString &UUID,
DICompositeType &CT) {
assert(CT.getRawIdentifier() == &UUID && "Mismatched UUID");
- if (CT.isForwardDecl())
- OldTypeRefs.FwdDecls.insert(std::make_pair(&UUID, &CT));
- else
- OldTypeRefs.Final.insert(std::make_pair(&UUID, &CT));
+ OldTypeRefs.Final.insert(std::make_pair(&UUID, &CT));
}
Metadata *BitcodeReaderMetadataList::upgradeTypeRef(Metadata *MaybeUUID) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28088.82432.patch
Type: text/x-patch
Size: 1428 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161224/775fe86d/attachment.bin>
More information about the llvm-commits
mailing list