mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Fix isEliminableCastPair to work correctly in the presence of pointers
with different sizes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167018 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -87,9 +87,13 @@ foldConstantCastPair(
|
||||
Instruction::CastOps firstOp = Instruction::CastOps(Op->getOpcode());
|
||||
Instruction::CastOps secondOp = Instruction::CastOps(opc);
|
||||
|
||||
// Assume that pointers are never more than 64 bits wide.
|
||||
IntegerType *FakeIntPtrTy = Type::getInt64Ty(DstTy->getContext());
|
||||
|
||||
// Let CastInst::isEliminableCastPair do the heavy lifting.
|
||||
return CastInst::isEliminableCastPair(firstOp, secondOp, SrcTy, MidTy, DstTy,
|
||||
Type::getInt64Ty(DstTy->getContext()));
|
||||
FakeIntPtrTy, FakeIntPtrTy,
|
||||
FakeIntPtrTy);
|
||||
}
|
||||
|
||||
static Constant *FoldBitCast(Constant *V, Type *DestTy) {
|
||||
|
Reference in New Issue
Block a user