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

2016-05-10 Thread Derek Schuff via cfe-commits
dschuff added a comment. Well, I forgot to squash my local commits before landing, so this is r269085 thru r269089 :( Repository: rL LLVM http://reviews.llvm.org/D19275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.or

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

2016-05-10 Thread Derek Schuff via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL269085: Do not register incompatible C++ destructors with __cxa_atexit (authored by dschuff). Changed prior to commit: http://reviews.llvm.org/D19275?vs=56218&id=56751#toc Repository: rL LLVM http:/

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

2016-05-10 Thread Reid Kleckner via cfe-commits
rnk accepted this revision. rnk added a reviewer: rnk. rnk added a comment. lgtm http://reviews.llvm.org/D19275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2016-05-10 Thread JF Bastien via cfe-commits
jfb accepted this revision. jfb added a reviewer: jfb. jfb added a comment. This revision is now accepted and ready to land. lgtm http://reviews.llvm.org/D19275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/ma

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

2016-05-10 Thread Derek Schuff via cfe-commits
dschuff added a comment. Ping? http://reviews.llvm.org/D19275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2016-05-04 Thread Derek Schuff via cfe-commits
dschuff updated this revision to Diff 56218. dschuff added a comment. - Introduce CGCXXABI::canCallMismatchedFunctionType http://reviews.llvm.org/D19275 Files: lib/CodeGen/CGCXXABI.h lib/CodeGen/CGDeclCXX.cpp lib/CodeGen/ItaniumCXXABI.cpp test/CodeGenCXX/static-destructor.cpp Index: te

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

2016-05-04 Thread Derek Schuff via cfe-commits
dschuff added a comment. Thanks for the feedback, PTAL http://reviews.llvm.org/D19275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2016-04-27 Thread JF Bastien via cfe-commits
jfb added a subscriber: pcc. jfb added a comment. > I guess there's a more general issue here which is that LLVM appears to be > more permissive about prototype mismatch than wasm. Specifically, I'm > thinking about how swifterror relies on being able to pass extra parameters > to a function th

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

2016-04-27 Thread Reid Kleckner via cfe-commits
rnk added a subscriber: rnk. rnk added a comment. +1 for canCallMismatchedFunctionType. I guess there's a more general issue here which is that LLVM appears to be more permissive about prototype mismatch than wasm. Specifically, I'm thinking about how swifterror relies on being able to pass ext

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

2016-04-27 Thread Tim Northover via cfe-commits
t.p.northover added a comment. Yep, that sounds about perfect to me. Exactly what the different CXXABI classes are for, really. Tim. http://reviews.llvm.org/D19275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-b

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

2016-04-27 Thread JF Bastien via cfe-commits
jfb added a comment. @t.p.northover: would an acceptable solution be to add a new trait such as `CGM.getCXXABI().CanCallMismatchedFunctionType()` or something of the sort? ARM would set it to true, wasm to false. http://reviews.llvm.org/D19275 ___

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

2016-04-27 Thread Tim Northover via cfe-commits
t.p.northover added a comment. I'm opposed to the changes on ARM. It would be undefined behaviour if the user wrote it at the C level, but not LLVM IR I think, which means Clang is perfectly entitled to emit calls like that. Tim. http://reviews.llvm.org/D19275 _

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

2016-04-22 Thread Derek Schuff via cfe-commits
dschuff added a subscriber: rengolin. dschuff added a comment. any comments from @t.p.northover or perhaps @rengolin ? (This does have a potential new cost on ARM, as it requires one thunk (which is just a tail call) per static initializer on ARM and WebAssembly) http://reviews.llvm.org/D19275

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

2016-04-19 Thread Derek Schuff via cfe-commits
dschuff updated this revision to Diff 54274. dschuff marked 2 inline comments as done. dschuff added a comment. - Clean up condition, add ARM to test - Clarify condition, remove redundant check - more cleanup http://reviews.llvm.org/D19275 Files: lib/CodeGen/CGDeclCXX.cpp test/CodeGenCXX/ru

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

2016-04-19 Thread JF Bastien via cfe-commits
jfb added a comment. lgtm besides two nits. Would be good to get a review from @t.p.northover or someone from ARM. Comment at: lib/CodeGen/CGDeclCXX.cpp:95 @@ +94,3 @@ + Record->getDestructor(), Dtor_Complete)); + // If __cxa_atexit is disable

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

2016-04-19 Thread Derek Schuff via cfe-commits
dschuff added inline comments. Comment at: lib/CodeGen/CGDeclCXX.cpp:92 @@ +91,3 @@ + // disabled via a flag, a different helper function is generated anyway. + const CXXRecordDecl *Record = type->getAsCXXRecordDecl(); + bool CanRegisterDestructor = Record && j

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

2016-04-19 Thread Derek Schuff via cfe-commits
dschuff updated this revision to Diff 54264. dschuff added a comment. - Clarify condition, remove redundant check http://reviews.llvm.org/D19275 Files: lib/CodeGen/CGDeclCXX.cpp test/CodeGenCXX/runtimecc.cpp test/CodeGenCXX/static-destructor.cpp Index: test/CodeGenCXX/static-destructor.c

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

2016-04-19 Thread JF Bastien via cfe-commits
jfb added inline comments. Comment at: lib/CodeGen/CGDeclCXX.cpp:92 @@ +91,3 @@ + // disabled via a flag, a different helper function is generated anyway. + const CXXRecordDecl *Record = type->getAsCXXRecordDecl(); + bool CanRegisterDestructor = Record && Can y

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

2016-04-19 Thread Derek Schuff via cfe-commits
dschuff updated this revision to Diff 54260. dschuff marked 3 inline comments as done. dschuff added a comment. - Clean up condition, add ARM to test http://reviews.llvm.org/D19275 Files: lib/CodeGen/CGDeclCXX.cpp test/CodeGenCXX/runtimecc.cpp test/CodeGenCXX/static-destructor.cpp Index:

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

2016-04-19 Thread JF Bastien via cfe-commits
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( -

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

2016-04-19 Thread Derek Schuff via cfe-commits
dschuff added a reviewer: sunfish. dschuff added a comment. Will want a reviewer who's involved with ARM too, still looking. http://reviews.llvm.org/D19275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

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

2016-04-19 Thread Derek Schuff via cfe-commits
dschuff created this revision. dschuff added a subscriber: cfe-commits. Herald added subscribers: dschuff, jfb, aemerson. For a static object with a nontrivial destructor, clang generates an initializer function (__cxx_global_var_init) which registers that object's destructor using __cxa_atexit. H