GET_OR_DISTINCT(MDDerivedType, Record[0],
(Context, Record[1], getMDString(Record[2]),
getMDOrNull(Record[3]), Record[4],
- getMDOrNull(Record[5]), getMD(Record[6]), Record[7],
- Record[8], Record[9], Record[10],
+ getMDOrNull(Record[5]), getMDOrNull(Record[6]),
+ Record[7], Record[8], Record[9], Record[10],
getMDOrNull(Record[11]))),
NextMDValueNo++);
break;
return Error("Invalid record");
MDValueList.AssignValue(
- GET_OR_DISTINCT(
- MDCompileUnit, Record[0],
- (Context, Record[1], getMD(Record[2]), getMDString(Record[3]),
- Record[4], getMDString(Record[5]), Record[6],
- getMDString(Record[7]), Record[8], getMDOrNull(Record[9]),
- getMDOrNull(Record[10]), getMDOrNull(Record[11]),
- getMDOrNull(Record[12]), getMDOrNull(Record[13]))),
+ GET_OR_DISTINCT(MDCompileUnit, Record[0],
+ (Context, Record[1], getMDOrNull(Record[2]),
+ getMDString(Record[3]), Record[4],
+ getMDString(Record[5]), Record[6],
+ getMDString(Record[7]), Record[8],
+ getMDOrNull(Record[9]), getMDOrNull(Record[10]),
+ getMDOrNull(Record[11]), getMDOrNull(Record[12]),
+ getMDOrNull(Record[13]))),
NextMDValueNo++);
break;
}
Record.push_back(VE.getMetadataOrNullID(N->getFile()));
Record.push_back(N->getLine());
Record.push_back(VE.getMetadataOrNullID(N->getScope()));
- Record.push_back(VE.getMetadataID(N->getBaseType()));
+ Record.push_back(VE.getMetadataOrNullID(N->getBaseType()));
Record.push_back(N->getSizeInBits());
Record.push_back(N->getAlignInBits());
Record.push_back(N->getOffsetInBits());
unsigned Abbrev) {
Record.push_back(N->isDistinct());
Record.push_back(N->getSourceLanguage());
- Record.push_back(VE.getMetadataID(N->getFile()));
+ Record.push_back(VE.getMetadataOrNullID(N->getFile()));
Record.push_back(VE.getMetadataOrNullID(N->getRawProducer()));
Record.push_back(N->isOptimized());
Record.push_back(VE.getMetadataOrNullID(N->getRawFlags()));
Out << Lang;
else
Out << N->getSourceLanguage();
- if (N->getFile()) {
- Out << FS << "file: ";
- writeMetadataAsOperand(Out, N->getFile(), TypePrinter, Machine,
- Context);
- }
+ Out << FS << "file: ";
+ writeMetadataAsOperand(Out, N->getFile(), TypePrinter, Machine, Context);
if (!N->getProducer().empty())
Out << FS << "producer: \"" << N->getProducer() << "\"";
Out << FS << "isOptimized: " << (N->isOptimized() ? "true" : "false");
--- /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; Don't crash on null operands. (If/when we add a verify check for these, we
+; should disable the verifier for this test and remove this comment; the test
+; is still important.)
+!named = !{!0, !1}
+!0 = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: null)
+!1 = !MDCompileUnit(language: DW_LANG_C, file: null)
+
+; CHECK: !named = !{!0, !1}
+; CHECK: !0 = !MDDerivedType({{.*}}baseType: null{{.*}})
+; CHECK: !1 = !MDCompileUnit({{.*}}file: null{{.*}})