[llvm-commits] [llvm] r93042 - /llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
Chris Lattner
sabre at nondot.org
Fri Jan 8 18:02:41 PST 2010
Author: lattner
Date: Fri Jan 8 20:02:37 2010
New Revision: 93042
URL: http://llvm.org/viewvc/llvm-project?rev=93042&view=rev
Log:
clean up this code, add a fixme.
Modified:
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=93042&r1=93041&r2=93042&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Fri Jan 8 20:02:37 2010
@@ -789,18 +789,18 @@
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;
}
More information about the llvm-commits
mailing list