ResultTy = PointerType::get(getTypeByID(Record[0], true));
break;
case bitc::TYPE_CODE_FUNCTION: {
- // FUNCTION: [vararg, retty, paramty x N]
- if (Record.size() < 2)
+ // FIXME: attrid is dead, remove it in LLVM 3.0
+ // FUNCTION: [vararg, attrid, retty, paramty x N]
+ if (Record.size() < 3)
return Error("Invalid FUNCTION type record");
std::vector<const Type*> ArgTys;
- for (unsigned i = 2, e = Record.size(); i != e; ++i)
+ for (unsigned i = 3, e = Record.size(); i != e; ++i)
ArgTys.push_back(getTypeByID(Record[i], true));
- ResultTy = FunctionType::get(getTypeByID(Record[1], true), ArgTys,
+ ResultTy = FunctionType::get(getTypeByID(Record[2], true), ArgTys,
Record[0]);
break;
}
Abbv = new BitCodeAbbrev();
Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_FUNCTION));
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isvararg
+ Abbv->Add(BitCodeAbbrevOp(0)); // FIXME: DEAD value, remove in LLVM 3.0
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
Log2_32_Ceil(VE.getTypes().size()+1)));
case Type::FunctionTyID: {
const FunctionType *FT = cast<FunctionType>(T);
- // FUNCTION: [isvararg, retty, paramty x N]
+ // FUNCTION: [isvararg, attrid, retty, paramty x N]
Code = bitc::TYPE_CODE_FUNCTION;
TypeVals.push_back(FT->isVarArg());
+ TypeVals.push_back(0); // FIXME: DEAD: remove in llvm 3.0
TypeVals.push_back(VE.getTypeID(FT->getReturnType()));
for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i)
TypeVals.push_back(VE.getTypeID(FT->getParamType(i)));