mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -206,14 +206,14 @@ static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset,
|
||||
Value *CastOp = cast<CastInst>(V)->getOperand(0);
|
||||
unsigned OldWidth = Scale.getBitWidth();
|
||||
unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits();
|
||||
Scale.trunc(SmallWidth);
|
||||
Offset.trunc(SmallWidth);
|
||||
Scale = Scale.trunc(SmallWidth);
|
||||
Offset = Offset.trunc(SmallWidth);
|
||||
Extension = isa<SExtInst>(V) ? EK_SignExt : EK_ZeroExt;
|
||||
|
||||
Value *Result = GetLinearExpression(CastOp, Scale, Offset, Extension,
|
||||
TD, Depth+1);
|
||||
Scale.zext(OldWidth);
|
||||
Offset.zext(OldWidth);
|
||||
Scale = Scale.zext(OldWidth);
|
||||
Offset = Offset.zext(OldWidth);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user