mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Preserve the inbounds flag, so that the constant folder doesn't
recompute it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81634 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
349a2ebbb3
commit
4acac62e8d
@ -437,8 +437,11 @@ struct ConvertConstantType<ConstantExpr, Type> {
|
||||
case Instruction::GetElementPtr:
|
||||
// Make everyone now use a constant of the new type...
|
||||
std::vector<Value*> Idx(OldC->op_begin()+1, OldC->op_end());
|
||||
New = ConstantExpr::getGetElementPtrTy(NewTy, OldC->getOperand(0),
|
||||
&Idx[0], Idx.size());
|
||||
New = cast<GEPOperator>(OldC)->isInBounds() ?
|
||||
ConstantExpr::getInBoundsGetElementPtrTy(NewTy, OldC->getOperand(0),
|
||||
&Idx[0], Idx.size()) :
|
||||
ConstantExpr::getGetElementPtrTy(NewTy, OldC->getOperand(0),
|
||||
&Idx[0], Idx.size());
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user