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); }