// stream, so we have to delete it when we're done.
//
if (DataSize != 1) {
- // FIXME, PR82
- TempScale = BinaryOperator::create(Instruction::Mul, Index,
- ConstantSInt::get(Type::LongTy,
- DataSize));
+ Value *CST;
+ if (Index->getType()->isSigned())
+ CST = ConstantSInt::get(Index->getType(), DataSize);
+ else
+ CST = ConstantUInt::get(Index->getType(), DataSize);
+
+ TempScale = BinaryOperator::create(Instruction::Mul, Index, CST);
Index = TempScale;
}
if (const CompositeType *CT = dyn_cast<CompositeType>(LoadedTy)) {
std::vector<Value*> Indices;
- // FIXME, PR82
- Indices.push_back(ConstantSInt::get(Type::LongTy, 0));
+ Indices.push_back(Constant::getNullValue(Type::UIntTy));
unsigned Offset = 0; // No offset, get first leaf.
LoadedTy = getStructOffsetType(CT, Offset, Indices, TD, false);
const StructType *SElTy = cast<StructType>(ElTy);
std::vector<Value*> Indices;
- // FIXME, PR82
- Indices.push_back(Constant::getNullValue(Type::LongTy));
+ Indices.push_back(Constant::getNullValue(Type::UIntTy));
unsigned Offset = 0;
const Type *Ty = getStructOffsetType(ElTy, Offset, Indices, TD,false);
if (isa<StructType>(ValTy)) {
std::vector<Value*> Indices;
- // FIXME: PR82
- Indices.push_back(Constant::getNullValue(Type::LongTy));
+ Indices.push_back(Constant::getNullValue(Type::UIntTy));
unsigned Offset = 0;
ValTy = getStructOffsetType(ValTy, Offset, Indices, TD, false);
if (DataSize != 1) {
// Insert a multiply of the old element type is not a unit size...
- Index = BinaryOperator::create(Instruction::Mul, Index,
- // FIXME: PR82
- ConstantSInt::get(Type::LongTy, DataSize),
- "scale", It);
+ Value *CST;
+ if (Index->getType()->isSigned())
+ CST = ConstantSInt::get(Index->getType(), DataSize);
+ else
+ CST = ConstantUInt::get(Index->getType(), DataSize);
+
+ Index = BinaryOperator::create(Instruction::Mul, Index, CST, "scale", It);
}
// Perform the conversion now...