示例#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);
}
示例#2
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);
}
示例#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();
}
示例#4
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();
}