コード例 #1
0
ファイル: TypeTableBuilder.cpp プロジェクト: bryant/llvm
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
ファイル: TypeTableBuilder.cpp プロジェクト: CSI-LLVM/llvm
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);
}