aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index d22d467..8393cd4 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -734,6 +734,23 @@ bool BitcodeReader::ParseMetadata() {
switch (Stream.ReadRecord(Code, Record)) {
default: // Default behavior: ignore.
break;
+ case bitc::METADATA_NODE: {
+ if (Record.empty() || Record.size() % 2 == 1)
+ return Error("Invalid METADATA_NODE record");
+
+ unsigned Size = Record.size();
+ SmallVector<Value*, 8> Elts;
+ for (unsigned i = 0; i != Size; i += 2) {
+ const Type *Ty = getTypeByID(Record[i], false);
+ if (Ty != Type::VoidTy)
+ Elts.push_back(ValueList.getValueFwdRef(Record[i+1], Ty));
+ else
+ Elts.push_back(NULL);
+ }
+ Value *V = Context.getMDNode(&Elts[0], Elts.size());
+ ValueList.AssignValue(V, NextValueNo++);
+ break;
+ }
case bitc::METADATA_STRING: {
unsigned MDStringLength = Record.size();
SmallString<8> String;
@@ -1078,22 +1095,6 @@ bool BitcodeReader::ParseConstants() {
AsmStr, ConstrStr, HasSideEffects);
break;
}
- case bitc::CST_CODE_MDNODE: {
- if (Record.empty() || Record.size() % 2 == 1)
- return Error("Invalid CST_MDNODE record");
-
- unsigned Size = Record.size();
- SmallVector<Value*, 8> Elts;
- for (unsigned i = 0; i != Size; i += 2) {
- const Type *Ty = getTypeByID(Record[i], false);
- if (Ty != Type::VoidTy)
- Elts.push_back(ValueList.getValueFwdRef(Record[i+1], Ty));
- else
- Elts.push_back(NULL);
- }
- V = Context.getMDNode(&Elts[0], Elts.size());
- break;
- }
}
ValueList.AssignValue(V, NextCstNo);