Loading llvm/lib/Transforms/Scalar/InstructionCombining.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -7767,11 +7767,6 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { const FunctionType *FT = Callee->getFunctionType(); const Type *OldRetTy = Caller->getType(); // Check to see if we are changing the return type... if (OldRetTy != FT->getReturnType()) { if (Callee->isDeclaration() && !Caller->use_empty() && // Conversion is ok if changing from pointer to int of same size. !(isa<PointerType>(FT->getReturnType()) && const FunctionType *ActualFT = cast<FunctionType>(cast<PointerType>(CE->getType())->getElementType()); Loading @@ -7780,6 +7775,11 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { if (FT->getParamAttrs() != ActualFT->getParamAttrs()) return false; // Check to see if we are changing the return type... if (OldRetTy != FT->getReturnType()) { if (Callee->isDeclaration() && !Caller->use_empty() && // Conversion is ok if changing from pointer to int of same size. !(isa<PointerType>(FT->getReturnType()) && TD->getIntPtrType() == OldRetTy)) return false; // Cannot transform this return value. Loading Loading
llvm/lib/Transforms/Scalar/InstructionCombining.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -7767,11 +7767,6 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { const FunctionType *FT = Callee->getFunctionType(); const Type *OldRetTy = Caller->getType(); // Check to see if we are changing the return type... if (OldRetTy != FT->getReturnType()) { if (Callee->isDeclaration() && !Caller->use_empty() && // Conversion is ok if changing from pointer to int of same size. !(isa<PointerType>(FT->getReturnType()) && const FunctionType *ActualFT = cast<FunctionType>(cast<PointerType>(CE->getType())->getElementType()); Loading @@ -7780,6 +7775,11 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { if (FT->getParamAttrs() != ActualFT->getParamAttrs()) return false; // Check to see if we are changing the return type... if (OldRetTy != FT->getReturnType()) { if (Callee->isDeclaration() && !Caller->use_empty() && // Conversion is ok if changing from pointer to int of same size. !(isa<PointerType>(FT->getReturnType()) && TD->getIntPtrType() == OldRetTy)) return false; // Cannot transform this return value. Loading