summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCXX.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-11-13 23:20:45 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-11-13 23:20:45 +0000
commitd967badc646853e895a391439560e155c85d70c1 (patch)
treec5c7d5d5667778d22a14c289224ca9de0dc22856 /clang/lib/CodeGen/CGCXX.cpp
parent59e4a6f5e2f7434ec6ec8bf334d211256105c897 (diff)
downloadbcm5719-llvm-d967badc646853e895a391439560e155c85d70c1.tar.gz
bcm5719-llvm-d967badc646853e895a391439560e155c85d70c1.zip
Don't use alias from derived dtor to base dtor at -O0.
This patch disables aliasing (and rauw) of derived dtors to base dtors at -O0. This optimization can have a negative impact on the debug quality. This was a latent bug for some time with local classes, but got noticed when it was generalized and broke gdb's destrprint.exp. llvm-svn: 194618
Diffstat (limited to 'clang/lib/CodeGen/CGCXX.cpp')
-rw-r--r--clang/lib/CodeGen/CGCXX.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp
index 581962f4a4d..22baa654084 100644
--- a/clang/lib/CodeGen/CGCXX.cpp
+++ b/clang/lib/CodeGen/CGCXX.cpp
@@ -34,6 +34,11 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) {
if (!getCodeGenOpts().CXXCtorDtorAliases)
return true;
+ // Producing an alias to a base class ctor/dtor can degrade debug quality
+ // as the debugger cannot tell them appart.
+ if (getCodeGenOpts().OptimizationLevel == 0)
+ return true;
+
// If the destructor doesn't have a trivial body, we have to emit it
// separately.
if (!D->hasTrivialBody())
OpenPOWER on IntegriCloud