METADATA_BASIC_TYPE = 15, // [distinct, tag, name, size, align, enc]
METADATA_FILE = 16, // [distinct, filename, directory]
METADATA_DERIVED_TYPE = 17, // [distinct, ...]
- METADATA_COMPOSITE_TYPE= 18 // [distinct, ...]
+ METADATA_COMPOSITE_TYPE= 18, // [distinct, ...]
+ METADATA_SUBROUTINE_TYPE= 19 // [distinct, flags, types]
};
// The constants block (CONSTANTS_BLOCK_ID) describes emission for each
Record.clear();
}
-static void WriteMDSubroutineType(const MDSubroutineType *,
- const ValueEnumerator &, BitstreamWriter &,
- SmallVectorImpl<uint64_t> &, unsigned) {
- llvm_unreachable("write not implemented");
+static void WriteMDSubroutineType(const MDSubroutineType *N,
+ const ValueEnumerator &VE,
+ BitstreamWriter &Stream,
+ SmallVectorImpl<uint64_t> &Record,
+ unsigned Abbrev) {
+ Record.push_back(N->isDistinct());
+ Record.push_back(N->getFlags());
+ Record.push_back(VE.getMetadataOrNullID(N->getTypeArray()));
+
+ Stream.EmitRecord(bitc::METADATA_SUBROUTINE_TYPE, Record, Abbrev);
+ Record.clear();
}
static void WriteMDFile(const MDFile *N, const ValueEnumerator &VE,
Out << ")";
}
-static void writeMDSubroutineType(raw_ostream &, const MDSubroutineType *,
- TypePrinting *, SlotTracker *,
- const Module *) {
- llvm_unreachable("write not implemented");
+static void writeMDSubroutineType(raw_ostream &Out, const MDSubroutineType *N,
+ TypePrinting *TypePrinter,
+ SlotTracker *Machine, const Module *Context) {
+ Out << "!MDSubroutineType(";
+ FieldSeparator FS;
+ if (N->getFlags())
+ Out << FS << "flags: " << N->getFlags();
+ Out << FS << "types: ";
+ writeMetadataAsOperand(Out, N->getTypeArray(), TypePrinter, Machine, Context);
+ Out << ")";
}
static void writeMDFile(raw_ostream &Out, const MDFile *N, TypePrinting *,
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
; RUN: verify-uselistorder %s
-; CHECK: !named = !{!0, !0, !1, !2, !3, !4, !5, !6, !7, !8, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24}
-!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26}
+; CHECK: !named = !{!0, !0, !1, !2, !3, !4, !5, !6, !7, !8, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !27}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30}
; CHECK: !0 = !MDSubrange(count: 3)
; CHECK-NEXT: !1 = !MDSubrange(count: 3, lowerBound: 4)
!24 = !MDDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !7, size: 32, align: 32, extraData: !17)
!25 = !MDCompositeType(tag: DW_TAG_structure_type)
!26 = !MDCompositeType(tag: DW_TAG_structure_type, runtimeLang: 6)
+
+; !25 = !{!7, !7}
+; !26 = !MDSubroutineType(flags: 7, types: !25)
+; !27 = !MDSubroutineType(types: !25)
+!27 = !{!7, !7}
+!28 = !MDSubroutineType(flags: 7, types: !27)
+!29 = !MDSubroutineType(flags: 0, types: !27)
+!30 = !MDSubroutineType(types: !27)