summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-10-31 19:01:02 +0000
committerKostya Serebryany <kcc@google.com>2014-10-31 19:01:02 +0000
commit5f1b4e8f58cdad859568f7bf213fd6ad62dbb072 (patch)
tree79f00ed903539a528a7bc6a21a6318d879889cbd /clang/lib/CodeGen
parentea48bdc702035c369af37ff462cd0dd0925b2d8d (diff)
downloadbcm5719-llvm-5f1b4e8f58cdad859568f7bf213fd6ad62dbb072.tar.gz
bcm5719-llvm-5f1b4e8f58cdad859568f7bf213fd6ad62dbb072.zip
ignore -mconstructor-aliases when adding field paddings for asan
Summary: When we are adding field paddings for asan even an empty dtor has to remain in the code, so we ignore -mconstructor-aliases if the paddings are going to be added. Test Plan: added a test Reviewers: rsmith, rnk, rafael Reviewed By: rafael Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6038 llvm-svn: 220986
Diffstat (limited to 'clang/lib/CodeGen')
-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 a590afae0b3..e467891d107 100644
--- a/clang/lib/CodeGen/CGCXX.cpp
+++ b/clang/lib/CodeGen/CGCXX.cpp
@@ -46,6 +46,11 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) {
const CXXRecordDecl *Class = D->getParent();
+ // We are going to instrument this destructor, so give up even if it is
+ // currently empty.
+ if (Class->mayInsertExtraPadding())
+ return true;
+
// If we need to manipulate a VTT parameter, give up.
if (Class->getNumVBases()) {
// Extra Credit: passing extra parameters is perfectly safe
OpenPOWER on IntegriCloud