Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.766 -> 1.767
---
Log message:

Fix Transforms/InstCombine/2007-05-18-CastFoldBug.ll, a bug that devastates
objc code due to the way the FE lowers objc message sends.


---
Diffs of the changes:  (+8 -0)

 InstructionCombining.cpp |    8 ++++++++
 1 files changed, 8 insertions(+)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.766 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.767
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.766   Mon May 14 
19:16:00 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sat May 19 01:51:32 2007
@@ -7773,6 +7773,14 @@
   const FunctionType *FT = Callee->getFunctionType();
   const Type *OldRetTy = Caller->getType();
 
+  const FunctionType *ActualFT =
+    cast<FunctionType>(cast<PointerType>(CE->getType())->getElementType());
+  
+  // If the parameter attributes don't match up, don't do the xform.  We don't
+  // want to lose an sret attribute or something.
+  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() && 



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to