예제 #1
0
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);
}
예제 #2
0
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;
  }
}
예제 #3
0
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);
}
예제 #4
0
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();
}
예제 #5
0
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();
}
예제 #6
0
Error TypeNameComputer::visitKnownRecord(CVType &CVR, EnumRecord &Enum) {
  Name = Enum.getName();
  return Error::success();
}