Handle another case that Frits suggested.

llvm-svn: 128068
This commit is contained in:
Anders Carlsson 2011-03-22 03:21:01 +00:00
parent 7bf595348e
commit 1cc8073bb3
1 changed files with 4 additions and 2 deletions

View File

@ -2746,11 +2746,13 @@ static bool cxxDtorIsEmpty(const Function &Fn,
if (!CalledFn)
return false;
SmallPtrSet<const Function *, 8> NewCalledFunctions(CalledFunctions);
// Don't treat recursive functions as empty.
if (!CalledFunctions.insert(CalledFn))
if (!NewCalledFunctions.insert(CalledFn))
return false;
if (!cxxDtorIsEmpty(*CalledFn, CalledFunctions))
if (!cxxDtorIsEmpty(*CalledFn, NewCalledFunctions))
return false;
} else if (isa<ReturnInst>(*I))
return true;