Check multiple return values.

llvm-svn: 48267
This commit is contained in:
Devang Patel 2008-03-12 00:32:32 +00:00
parent dc5b6b2e5d
commit cc189b5606

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