diff options
author | Tanya Lattner <tonic@nondot.org> | 2007-05-23 06:07:37 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2007-05-23 06:07:37 +0000 |
commit | eff75f4c9f2c3b8c4cccb825eb2310cbc5659275 (patch) | |
tree | 834d487e08fa8a06017a17c3f9e8ca0e900dfdb5 | |
parent | 377c6864a481b27c968904c05e653ad79cc4192c (diff) |
Fixing patch mistake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_20@37303 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 256b2fd41a..482e1722c9 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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. |