From 755a21f3ae7edcb932874d69d9726e683d4f556b Mon Sep 17 00:00:00 2001 From: Tanya Lattner <tonic@nondot.org> Date: Wed, 23 May 2007 06:07:37 +0000 Subject: [PATCH] Fixing patch mistake. llvm-svn: 37303 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 256b2fd41ab6..482e1722c92e 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -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()); @@ -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. -- GitLab