summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-13 19:33:27 +0000
committerDan Gohman <gohman@apple.com>2010-07-13 19:33:27 +0000
commit1e0213a75827425e19ca8f3dfe9604f23fbe3609 (patch)
tree5dfd24dd372884cc89596292c4defedd948b967f /llvm/lib/Bitcode
parent0cc4ad983d9511d1a02221c572670066b5858a8e (diff)
downloadbcm5719-llvm-1e0213a75827425e19ca8f3dfe9604f23fbe3609.tar.gz
bcm5719-llvm-1e0213a75827425e19ca8f3dfe9604f23fbe3609.zip
Add support for empty metadata nodes: !{}.
llvm-svn: 108259
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 527ae49b714..b3f0776d29d 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -820,7 +820,7 @@ bool BitcodeReader::ParseMetadata() {
IsFunctionLocal = true;
// fall-through
case bitc::METADATA_NODE: {
- if (Record.empty() || Record.size() % 2 == 1)
+ if (Record.size() % 2 == 1)
return Error("Invalid METADATA_NODE record");
unsigned Size = Record.size();
@@ -834,7 +834,8 @@ bool BitcodeReader::ParseMetadata() {
else
Elts.push_back(NULL);
}
- Value *V = MDNode::getWhenValsUnresolved(Context, &Elts[0], Elts.size(),
+ Value *V = MDNode::getWhenValsUnresolved(Context,
+ Elts.data(), Elts.size(),
IsFunctionLocal);
IsFunctionLocal = false;
MDValueList.AssignValue(V, NextMDValueNo++);
OpenPOWER on IntegriCloud