Check multiple return values.
authorDevang Patel <dpatel@apple.com>
Wed, 12 Mar 2008 00:32:32 +0000 (00:32 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 12 Mar 2008 00:32:32 +0000 (00:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48267 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/SimplifyLibCalls.cpp

index f4be9704b7a8936ebe4bae111cc014c880eface6..945eb909e50810e0df7cea98dcdeb2c4957ceb8b 100644 (file)
@@ -420,7 +420,8 @@ struct VISIBILITY_HIDDEN ExitInMainOptimization : public LibCallOptimization {
     // to exit have the same type.
     Function *from = ci->getParent()->getParent();
     if (from->hasExternalLinkage())
-      if (from->getReturnType() == ci->getOperand(1)->getType())
+      if (from->getReturnType() == ci->getOperand(1)->getType()
+          && !isa<StructType>(from->getReturnType()))
         if (from->getName() == "main") {
           // Okay, time to actually do the optimization. First, get the basic
           // block of the call instruction