diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-09 02:02:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-09 02:02:37 +0000 |
commit | 70644e92d810f36710bc289cda11e982b399fc88 (patch) | |
tree | aca49bfa9ce7c1108ad69c20502d6e1ba044ba52 /lib/Bitcode | |
parent | 87df867fd7f23cd2128a7ee38f4cebeb85e948a2 (diff) | |
download | external_llvm-70644e92d810f36710bc289cda11e982b399fc88.zip external_llvm-70644e92d810f36710bc289cda11e982b399fc88.tar.gz external_llvm-70644e92d810f36710bc289cda11e982b399fc88.tar.bz2 |
clean up this code, add a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93042 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index bec9c50..87c4fd7 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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; } |