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(); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits