[PATCH] D19275: Do not register incompatible C++ destructors with __cxa_atexit

JF Bastien via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 11:25:29 PDT 2016


jfb added inline comments.

================
Comment at: lib/CodeGen/CGDeclCXX.cpp:94
@@ -92,2 +93,3 @@
   if (dtorKind == QualType::DK_cxx_destructor &&
-      (record = type->getAsCXXRecordDecl())) {
+      (record = type->getAsCXXRecordDecl()) &&
+      (!CGM.getCXXABI().HasThisReturn(
----------------
This assignment is looking pretty ugly now, would be better to move out of line.

================
Comment at: lib/CodeGen/CGDeclCXX.cpp:97
@@ -94,1 +96,3 @@
+          GlobalDecl(record->getDestructor(), Dtor_Complete)) ||
+       !CGM.getCodeGenOpts().CXAAtExit)) {
     assert(!record->hasTrivialDestructor());
----------------
Could you also pull out these conditions into their own bool? I find the ands and ors hard to follow!

================
Comment at: test/CodeGenCXX/static-destructor.cpp:6
@@ +5,3 @@
+// signatures do not match the type of its first argument.
+// e.g. ARM and WebAssembly have destructors that return this instead of void.
+
----------------
You mention ARM but don't test ARM here.


http://reviews.llvm.org/D19275





More information about the cfe-commits mailing list