aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/IPO/SimplifyLibCalls.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/SimplifyLibCalls.cpp b/lib/Transforms/IPO/SimplifyLibCalls.cpp
index f4be9704b7..945eb909e5 100644
--- a/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/lib/Transforms/IPO/SimplifyLibCalls.cpp
@@ -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