Esempio n. 1
0
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);
}
Esempio n. 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;
  }
}
Esempio n. 3
0
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();
}
Esempio n. 4
0
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);
}
Esempio n. 5
0
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();
}
Esempio n. 6
0
Error TypeNameComputer::visitKnownRecord(CVType &CVR, UnionRecord &Union) {
  Name = Union.getName();
  return Error::success();
}