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