[PATCH] D54542: Remove unused getMDNodeFwdRefOrNull interfaces (NFC)
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 14 13:53:05 PST 2018
tejohnson created this revision.
tejohnson added a reviewer: steven_wu.
Followup from https://reviews.llvm.org/D53596/r346891. Remove the getMDNodeFwdRefOrNull interface
to the MDLoader since it is no longer used. Also improve error messages
when the internal implementation is used within the MDLoader.
Repository:
rL LLVM
https://reviews.llvm.org/D54542
Files:
lib/Bitcode/Reader/MetadataLoader.cpp
lib/Bitcode/Reader/MetadataLoader.h
Index: lib/Bitcode/Reader/MetadataLoader.h
===================================================================
--- lib/Bitcode/Reader/MetadataLoader.h
+++ lib/Bitcode/Reader/MetadataLoader.h
@@ -65,8 +65,6 @@
/// necessary.
Metadata *getMetadataFwdRefOrLoad(unsigned Idx);
- MDNode *getMDNodeFwdRefOrNull(unsigned Idx);
-
/// Return the DISubprogram metadata for a Function if any, null otherwise.
DISubprogram *lookupSubprogramForFunction(Function *F);
Index: lib/Bitcode/Reader/MetadataLoader.cpp
===================================================================
--- lib/Bitcode/Reader/MetadataLoader.cpp
+++ lib/Bitcode/Reader/MetadataLoader.cpp
@@ -650,10 +650,6 @@
return MetadataList.getMetadataFwdRef(ID);
}
- MDNode *getMDNodeFwdRefOrNull(unsigned Idx) {
- return MetadataList.getMDNodeFwdRefOrNull(Idx);
- }
-
DISubprogram *lookupSubprogramForFunction(Function *F) {
return FunctionsWithSPs.lookup(F);
}
@@ -772,7 +768,7 @@
// It is acknowledged by 'TODO: Inherit from Metadata' in the
// NamedMDNode class definition.
MDNode *MD = MetadataList.getMDNodeFwdRefOrNull(Record[i]);
- assert(MD && "Invalid record");
+ assert(MD && "Invalid metadata: expect fwd ref to MDNode");
NMD->addOperand(MD);
}
break;
@@ -1049,7 +1045,7 @@
for (unsigned i = 0; i != Size; ++i) {
MDNode *MD = MetadataList.getMDNodeFwdRefOrNull(Record[i]);
if (!MD)
- return error("Invalid record");
+ return error("Invalid named metadata: expect fwd ref to MDNode");
NMD->addOperand(MD);
}
break;
@@ -1834,7 +1830,7 @@
return error("Invalid ID");
MDNode *MD = MetadataList.getMDNodeFwdRefOrNull(Record[I + 1]);
if (!MD)
- return error("Invalid metadata attachment");
+ return error("Invalid metadata attachment: expect fwd ref to MDNode");
GO.addMetadata(K->second, *MD);
}
return Error::success();
@@ -2004,10 +2000,6 @@
return Pimpl->getMetadataFwdRefOrLoad(Idx);
}
-MDNode *MetadataLoader::getMDNodeFwdRefOrNull(unsigned Idx) {
- return Pimpl->getMDNodeFwdRefOrNull(Idx);
-}
-
DISubprogram *MetadataLoader::lookupSubprogramForFunction(Function *F) {
return Pimpl->lookupSubprogramForFunction(F);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54542.174095.patch
Type: text/x-patch
Size: 2305 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181114/c8b92b10/attachment.bin>
More information about the llvm-commits
mailing list