diff options
author | Anders Carlsson <andersca@mac.com> | 2011-03-21 02:42:27 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-03-21 02:42:27 +0000 |
commit | 262a8627870c38f385944fc2ed9ae365347adf47 (patch) | |
tree | 1f9d9d434e98ff3122c33151c278a0159b3b3ae1 | |
parent | 35ee1c921c55ced16748b90c486c9feeb433c74b (diff) |
As suggested by Nick Lewycky, ignore debugging intrinsics when trying to decide whether a destructor is empty or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127985 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 60ede4f6d5..d8212e8894 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -2742,6 +2742,13 @@ static bool cxxDtorIsEmpty(const Function &Fn, if (!CalledFn) return false; + if (unsigned IntrinsicID = CalledFn->getIntrinsicID()) { + // Ignore debug intrinsics. + if (IntrinsicID == llvm::Intrinsic::dbg_declare || + IntrinsicID == llvm::Intrinsic::dbg_value) + continue; + } + // Don't treat recursive functions as empty. if (!CalledFunctions.insert(CalledFn)) return false; |