summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-03-22 03:21:01 +0000
committerAnders Carlsson <andersca@mac.com>2011-03-22 03:21:01 +0000
commit807bc2a3814bb45b38702785ad9978153d176698 (patch)
treeaadc138045b080f226453e634e6553918b4afeae
parentcb3c5d8e3ede2e2249cd0f5ba1313fe2221126a5 (diff)
downloadllvm-807bc2a3814bb45b38702785ad9978153d176698.tar.gz
llvm-807bc2a3814bb45b38702785ad9978153d176698.tar.bz2
llvm-807bc2a3814bb45b38702785ad9978153d176698.tar.xz
Handle another case that Frits suggested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128068 91177308-0d34-0410-b5e6-96231b3b80d8
-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;