diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-03-05 21:04:41 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-03-05 21:04:41 +0000 |
commit | 902ac3b762c91ce1c39accdb8c18a12f87f2a1c9 (patch) | |
tree | 07bd1423ba9354e5984adc98b663bddecb0f1cf1 /lib | |
parent | 12b5e1997d34b66062de7accc3a58429d5b8af51 (diff) | |
download | clang-902ac3b762c91ce1c39accdb8c18a12f87f2a1c9.tar.gz |
Don't produce an alias between destructors with different calling conventions.
Fixes pr19007.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index ed8c80500b..9904906571 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -92,7 +92,13 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) { if (!ClassLayout.getBaseClassOffset(UniqueBase).isZero()) return true; + // Give up if the calling conventions don't match. We could update the call, + // but it is probably not worth it. const CXXDestructorDecl *BaseD = UniqueBase->getDestructor(); + if (BaseD->getType()->getAs<FunctionType>()->getCallConv() != + D->getType()->getAs<FunctionType>()->getCallConv()) + return true; + return TryEmitDefinitionAsAlias(GlobalDecl(D, Dtor_Base), GlobalDecl(BaseD, Dtor_Base), false); |