mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-13 08:35:46 +00:00
Permit the IntPtrTy argument to isEliminableCastPair to be null,
to help support use when TargetData is not available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76675 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aedb59a541
commit
295643b805
@ -479,7 +479,7 @@ public:
|
||||
const Type *SrcTy, ///< SrcTy of 1st cast
|
||||
const Type *MidTy, ///< DstTy of 1st cast & SrcTy of 2nd cast
|
||||
const Type *DstTy, ///< DstTy of 2nd cast
|
||||
const Type *IntPtrTy ///< Integer type corresponding to Ptr types
|
||||
const Type *IntPtrTy ///< Integer type corresponding to Ptr types, or null
|
||||
);
|
||||
|
||||
/// @brief Return the opcode of this CastInst
|
||||
|
@ -1890,6 +1890,8 @@ unsigned CastInst::isEliminableCastPair(
|
||||
return 0;
|
||||
case 7: {
|
||||
// ptrtoint, inttoptr -> bitcast (ptr -> ptr) if int size is >= ptr size
|
||||
if (!IntPtrTy)
|
||||
return 0;
|
||||
unsigned PtrSize = IntPtrTy->getScalarSizeInBits();
|
||||
unsigned MidSize = MidTy->getScalarSizeInBits();
|
||||
if (MidSize >= PtrSize)
|
||||
@ -1929,6 +1931,8 @@ unsigned CastInst::isEliminableCastPair(
|
||||
return 0;
|
||||
case 13: {
|
||||
// inttoptr, ptrtoint -> bitcast if SrcSize<=PtrSize and SrcSize==DstSize
|
||||
if (!IntPtrTy)
|
||||
return 0;
|
||||
unsigned PtrSize = IntPtrTy->getScalarSizeInBits();
|
||||
unsigned SrcSize = SrcTy->getScalarSizeInBits();
|
||||
unsigned DstSize = DstTy->getScalarSizeInBits();
|
||||
|
Loading…
x
Reference in New Issue
Block a user