forked from OSchip/llvm-project
parent
3050625a50
commit
9646c0d046
|
@ -90,7 +90,9 @@ namespace bitc {
|
|||
TYPE_CODE_OPAQUE = 6, // OPAQUE
|
||||
TYPE_CODE_INTEGER = 7, // INTEGER: [width]
|
||||
TYPE_CODE_POINTER = 8, // POINTER: [pointee type]
|
||||
TYPE_CODE_FUNCTION_OLD = 9, // FUNCTION: [vararg, attrid, retty, paramty x N]
|
||||
|
||||
TYPE_CODE_FUNCTION_OLD = 9, // FUNCTION: [vararg, attrid, retty,
|
||||
// paramty x N]
|
||||
|
||||
// Code #10 is unused.
|
||||
|
||||
|
|
|
@ -201,11 +201,12 @@ static void WriteTypeTable(const ValueEnumerator &VE, BitstreamWriter &Stream) {
|
|||
Stream.EnterSubblock(bitc::TYPE_BLOCK_ID_NEW, 4 /*count from # abbrevs */);
|
||||
SmallVector<uint64_t, 64> TypeVals;
|
||||
|
||||
uint64_t NumBits = Log2_32_Ceil(VE.getTypes().size()+1);
|
||||
|
||||
// Abbrev for TYPE_CODE_POINTER.
|
||||
BitCodeAbbrev *Abbv = new BitCodeAbbrev();
|
||||
Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_POINTER));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
|
||||
Log2_32_Ceil(VE.getTypes().size()+1)));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, NumBits));
|
||||
Abbv->Add(BitCodeAbbrevOp(0)); // Addrspace = 0
|
||||
unsigned PtrAbbrev = Stream.EmitAbbrev(Abbv);
|
||||
|
||||
|
@ -214,8 +215,8 @@ static void WriteTypeTable(const ValueEnumerator &VE, BitstreamWriter &Stream) {
|
|||
Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_FUNCTION));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isvararg
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
|
||||
Log2_32_Ceil(VE.getTypes().size()+1)));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, NumBits));
|
||||
|
||||
unsigned FunctionAbbrev = Stream.EmitAbbrev(Abbv);
|
||||
|
||||
// Abbrev for TYPE_CODE_STRUCT_ANON.
|
||||
|
@ -223,8 +224,8 @@ static void WriteTypeTable(const ValueEnumerator &VE, BitstreamWriter &Stream) {
|
|||
Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_STRUCT_ANON));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // ispacked
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
|
||||
Log2_32_Ceil(VE.getTypes().size()+1)));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, NumBits));
|
||||
|
||||
unsigned StructAnonAbbrev = Stream.EmitAbbrev(Abbv);
|
||||
|
||||
// Abbrev for TYPE_CODE_STRUCT_NAME.
|
||||
|
@ -239,16 +240,16 @@ static void WriteTypeTable(const ValueEnumerator &VE, BitstreamWriter &Stream) {
|
|||
Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_STRUCT_NAMED));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // ispacked
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
|
||||
Log2_32_Ceil(VE.getTypes().size()+1)));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, NumBits));
|
||||
|
||||
unsigned StructNamedAbbrev = Stream.EmitAbbrev(Abbv);
|
||||
|
||||
// Abbrev for TYPE_CODE_ARRAY.
|
||||
Abbv = new BitCodeAbbrev();
|
||||
Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_ARRAY));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // size
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
|
||||
Log2_32_Ceil(VE.getTypes().size()+1)));
|
||||
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, NumBits));
|
||||
|
||||
unsigned ArrayAbbrev = Stream.EmitAbbrev(Abbv);
|
||||
|
||||
// Emit an entry count so the reader can reserve space.
|
||||
|
|
Loading…
Reference in New Issue