TypeIndex TypeTableBuilder::writeKnownType(const UnionRecord &Record) { TypeRecordBuilder Builder(TypeRecordKind::Union); Builder.writeUInt16(Record.getMemberCount()); uint16_t Flags = static_cast<uint16_t>(Record.getOptions()) | (static_cast<uint16_t>(Record.getHfa()) << ClassRecord::HfaKindShift); Builder.writeUInt16(Flags); Builder.writeTypeIndex(Record.getFieldList()); Builder.writeEncodedUnsignedInteger(Record.getSize()); writeNameAndUniqueName(Builder, Record.getOptions(), Record.getName(), Record.getUniqueName()); return writeRecord(Builder); }
TypeIndex TypeTableBuilder::writeUnion(const UnionRecord &Record) { TypeRecordBuilder Builder(TypeRecordKind::Union); Builder.writeUInt16(Record.getMemberCount()); uint16_t Flags = static_cast<uint16_t>(Record.getOptions()) | (static_cast<uint16_t>(Record.getHfa()) << ClassRecord::HfaKindShift); Builder.writeUInt16(Flags); Builder.writeTypeIndex(Record.getFieldList()); Builder.writeEncodedUnsignedInteger(Record.getSize()); Builder.writeNullTerminatedString(Record.getName()); if ((Record.getOptions() & ClassOptions::HasUniqueName) != ClassOptions::None) { Builder.writeNullTerminatedString(Record.getUniqueName()); } return writeRecord(Builder); }
void CVTypeDumperImpl::visitUnion(TypeLeafKind Leaf, UnionRecord &Union) { uint16_t Props = static_cast<uint16_t>(Union.getOptions()); W.printNumber("MemberCount", Union.getMemberCount()); W.printFlags("Properties", Props, makeArrayRef(ClassOptionNames)); printTypeIndex("FieldList", Union.getFieldList()); W.printNumber("SizeOf", Union.getSize()); W.printString("Name", Union.getName()); if (Props & uint16_t(ClassOptions::HasUniqueName)) W.printString("LinkageName", Union.getUniqueName()); Name = Union.getName(); }
Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, UnionRecord &Union) { uint16_t Props = static_cast<uint16_t>(Union.getOptions()); W->printNumber("MemberCount", Union.getMemberCount()); W->printFlags("Properties", Props, makeArrayRef(ClassOptionNames)); printTypeIndex("FieldList", Union.getFieldList()); W->printNumber("SizeOf", Union.getSize()); W->printString("Name", Union.getName()); if (Props & uint16_t(ClassOptions::HasUniqueName)) W->printString("LinkageName", Union.getUniqueName()); return Error::success(); }