aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index 7f69aeb0d0..0087362e33 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<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;