From: Anders Carlsson Date: Tue, 22 Mar 2011 03:21:01 +0000 (+0000) Subject: Handle another case that Frits suggested. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=807bc2a3814bb45b38702785ad9978153d176698;p=oota-llvm.git Handle another case that Frits suggested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128068 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 7f69aeb0d02..0087362e339 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -2746,11 +2746,13 @@ static bool cxxDtorIsEmpty(const Function &Fn, if (!CalledFn) return false; + SmallPtrSet 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(*I)) return true;