mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-29 13:32:33 +00:00
If we can convert the return pointer type into an integer that IntPtrType
can be converted to losslessly, we can continue the conversion to a direct call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27880 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3b9adf8864
commit
8117f9a40e
@ -5681,8 +5681,10 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
// Check to see if we are changing the return type...
|
||||
if (OldRetTy != FT->getReturnType()) {
|
||||
if (Callee->isExternal() &&
|
||||
!OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType()) &&
|
||||
!Caller->use_empty())
|
||||
!(OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType()) ||
|
||||
(isa<PointerType>(FT->getReturnType()) &&
|
||||
OldRetTy->isLosslesslyConvertibleTo(TD->getIntPtrType())))
|
||||
&& !Caller->use_empty())
|
||||
return false; // Cannot transform this return value...
|
||||
|
||||
// If the callsite is an invoke instruction, and the return value is used by
|
||||
|
Loading…
x
Reference in New Issue
Block a user