Check multiple return values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48267 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2008-03-12 00:32:32 +00:00
parent 38459f01c0
commit 045497ae27

View 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