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); }