clean up this code, add a fixme.

llvm-svn: 93042
This commit is contained in:
Chris Lattner 2010-01-09 02:02:37 +00:00
parent bd58ff3f60
commit 8a92d699f8

View File

@ -789,18 +789,18 @@ bool BitcodeReader::ParseMetadata() {
unsigned Size = Record.size();
SmallVector<MDNode *, 8> Elts;
for (unsigned i = 0; i != Size; ++i) {
if (Record[i] == ~0U)
if (Record[i] == ~0U) {
Elts.push_back(NULL);
else {
Value *MD = MDValueList.getValueFwdRef(Record[i]);
if (MDNode *B = dyn_cast<MDNode>(MD))
Elts.push_back(B);
else
return Error("Malformed metadata record");
continue;
}
MDNode *MD = dyn_cast<MDNode>(MDValueList.getValueFwdRef(Record[i]));
if (MD == 0)
return Error("Malformed metadata record");
Elts.push_back(MD);
}
Value *V = NamedMDNode::Create(Context, Name.str(), Elts.data(),
Elts.size(), TheModule);
// FIXME: This shouldn't poke NextValueNo?
MDValueList.AssignValue(V, NextValueNo++);
break;
}