[llvm] r346899 - Remove unused getMDNodeFwdRefOrNull interfaces (NFC)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 14 13:57:51 PST 2018
Author: tejohnson
Date: Wed Nov 14 13:57:51 2018
New Revision: 346899
URL: http://llvm.org/viewvc/llvm-project?rev=346899&view=rev
Log:
Remove unused getMDNodeFwdRefOrNull interfaces (NFC)
Summary:
Followup from 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.
Reviewers: steven_wu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D54542
Modified:
llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp
llvm/trunk/lib/Bitcode/Reader/MetadataLoader.h
Modified: llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp?rev=346899&r1=346898&r2=346899&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp Wed Nov 14 13:57:51 2018
@@ -650,10 +650,6 @@ public:
return MetadataList.getMetadataFwdRef(ID);
}
- MDNode *getMDNodeFwdRefOrNull(unsigned Idx) {
- return MetadataList.getMDNodeFwdRefOrNull(Idx);
- }
-
DISubprogram *lookupSubprogramForFunction(Function *F) {
return FunctionsWithSPs.lookup(F);
}
@@ -772,7 +768,7 @@ MetadataLoader::MetadataLoaderImpl::lazy
// 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 @@ Error MetadataLoader::MetadataLoaderImpl
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 @@ Error MetadataLoader::MetadataLoaderImpl
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 @@ Metadata *MetadataLoader::getMetadataFwd
return Pimpl->getMetadataFwdRefOrLoad(Idx);
}
-MDNode *MetadataLoader::getMDNodeFwdRefOrNull(unsigned Idx) {
- return Pimpl->getMDNodeFwdRefOrNull(Idx);
-}
-
DISubprogram *MetadataLoader::lookupSubprogramForFunction(Function *F) {
return Pimpl->lookupSubprogramForFunction(F);
}
Modified: llvm/trunk/lib/Bitcode/Reader/MetadataLoader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/MetadataLoader.h?rev=346899&r1=346898&r2=346899&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/MetadataLoader.h (original)
+++ llvm/trunk/lib/Bitcode/Reader/MetadataLoader.h Wed Nov 14 13:57:51 2018
@@ -65,8 +65,6 @@ public:
/// necessary.
Metadata *getMetadataFwdRefOrLoad(unsigned Idx);
- MDNode *getMDNodeFwdRefOrNull(unsigned Idx);
-
/// Return the DISubprogram metadata for a Function if any, null otherwise.
DISubprogram *lookupSubprogramForFunction(Function *F);
More information about the llvm-commits
mailing list