r269088 - more cleanup
Derek Schuff via cfe-commits
cfe-commits at lists.llvm.org
Tue May 10 10:44:52 PDT 2016
Author: dschuff
Date: Tue May 10 12:44:52 2016
New Revision: 269088
URL: http://llvm.org/viewvc/llvm-project?rev=269088&view=rev
Log:
more cleanup
Modified:
cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=269088&r1=269087&r2=269088&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Tue May 10 12:44:52 2016
@@ -86,8 +86,9 @@ static void EmitDeclDestroy(CodeGenFunct
llvm::Constant *function;
llvm::Constant *argument;
- // Special-case non-array C++ destructors, if they have the right signature
- // that can be directly registered with __cxa_atexit.
+ // Special-case non-array C++ destructors, if they have the right signature.
+ // Under some ABIs, destructors return this instead of void, and cannot be
+ // passed directly to __cxa_atexit.
const CXXRecordDecl *Record = type->getAsCXXRecordDecl();
bool CanRegisterDestructor = Record &&
!CGM.getCXXABI().HasThisReturn(GlobalDecl(
@@ -96,8 +97,7 @@ static void EmitDeclDestroy(CodeGenFunct
// generated elsewhere which uses atexit instead, and it takes the destructor
// directly.
bool UsingExternalHelper = !CGM.getCodeGenOpts().CXAAtExit;
- if (Record &&
- (CanRegisterDestructor || UsingExternalHelper)) {
+ if (Record && (CanRegisterDestructor || UsingExternalHelper)) {
assert(!Record->hasTrivialDestructor());
CXXDestructorDecl *dtor = Record->getDestructor();
More information about the cfe-commits
mailing list