diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 7f69aeb0d02..0087362e339 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -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; |