TypeIndex TypeTableBuilder::writeKnownType(const EnumRecord &Record) { TypeRecordBuilder Builder(Record.getKind()); Builder.writeUInt16(Record.getMemberCount()); Builder.writeUInt16(static_cast<uint16_t>(Record.getOptions())); Builder.writeTypeIndex(Record.getUnderlyingType()); Builder.writeTypeIndex(Record.getFieldList()); writeNameAndUniqueName(Builder, Record.getOptions(), Record.getName(), Record.getUniqueName()); return writeRecord(Builder); }
bool lldb_private::npdb::IsForwardRefUdt(CVType cvt) { ClassRecord cr; UnionRecord ur; EnumRecord er; switch (cvt.kind()) { case LF_CLASS: case LF_STRUCTURE: case LF_INTERFACE: llvm::cantFail(TypeDeserializer::deserializeAs<ClassRecord>(cvt, cr)); return cr.isForwardRef(); case LF_UNION: llvm::cantFail(TypeDeserializer::deserializeAs<UnionRecord>(cvt, ur)); return ur.isForwardRef(); case LF_ENUM: llvm::cantFail(TypeDeserializer::deserializeAs<EnumRecord>(cvt, er)); return er.isForwardRef(); default: return false; } }
TypeIndex TypeTableBuilder::writeEnum(const EnumRecord &Record) { TypeRecordBuilder Builder(Record.getKind()); Builder.writeUInt16(Record.getMemberCount()); Builder.writeUInt16(static_cast<uint16_t>(Record.getOptions())); Builder.writeTypeIndex(Record.getUnderlyingType()); Builder.writeTypeIndex(Record.getFieldList()); Builder.writeNullTerminatedString(Record.getName()); if ((Record.getOptions() & ClassOptions::HasUniqueName) != ClassOptions::None) { Builder.writeNullTerminatedString(Record.getUniqueName()); } return writeRecord(Builder); }
Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, EnumRecord &Enum) { uint16_t Props = static_cast<uint16_t>(Enum.getOptions()); W->printNumber("NumEnumerators", Enum.getMemberCount()); W->printFlags("Properties", uint16_t(Enum.getOptions()), makeArrayRef(ClassOptionNames)); printTypeIndex("UnderlyingType", Enum.getUnderlyingType()); printTypeIndex("FieldListType", Enum.getFieldList()); W->printString("Name", Enum.getName()); if (Props & uint16_t(ClassOptions::HasUniqueName)) W->printString("LinkageName", Enum.getUniqueName()); return Error::success(); }
void CVTypeDumperImpl::visitEnum(TypeLeafKind Leaf, EnumRecord &Enum) { W.printNumber("NumEnumerators", Enum.getMemberCount()); W.printFlags("Properties", uint16_t(Enum.getOptions()), makeArrayRef(ClassOptionNames)); printTypeIndex("UnderlyingType", Enum.getUnderlyingType()); printTypeIndex("FieldListType", Enum.getFieldList()); W.printString("Name", Enum.getName()); Name = Enum.getName(); }
Error TypeNameComputer::visitKnownRecord(CVType &CVR, EnumRecord &Enum) { Name = Enum.getName(); return Error::success(); }