aboutsummaryrefslogtreecommitdiffstats
path: root/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
commitac80975ea4103fcceab38cde69d98d3fb3b01db4 (patch)
tree85c4c423ff223892d372ed3b3446f9859e945520 /lib/Bitcode
parent218977b53eb215e5534db2f727d109ab18817cc1 (diff)
downloadexternal_llvm-ac80975ea4103fcceab38cde69d98d3fb3b01db4.zip
external_llvm-ac80975ea4103fcceab38cde69d98d3fb3b01db4.tar.gz
external_llvm-ac80975ea4103fcceab38cde69d98d3fb3b01db4.tar.bz2
Add support for empty metadata nodes: !{}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 527ae49..b3f0776 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/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++);