[PATCH] D43430: Omit nullptr check for sufficiently simple delete-expressions

2018-02-24 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. That is an extremely Google-specific analysis, actually; AFAIK almost nobody else uses static linking all the way down to and including the C and C++ standard libraries unless they're literally building an executable for a fully-static environment, like the kernel. Th

[PATCH] D43430: Omit nullptr check for sufficiently simple delete-expressions

2018-02-23 Thread Andrew Hunter via Phabricator via cfe-commits
ahh added a comment. > If the pointer is not null, the runtime overhead of the null check is pretty > negligible next to the cost of actually doing the allocation. If the pointer > is null, the runtime overhead of making at least one unnecessary call — > probably two, if 'operator delete' doesn

[PATCH] D43430: Omit nullptr check for sufficiently simple delete-expressions

2018-02-19 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Discourse nitpick: I would encourage you to just use the ordinary phrase "null pointer", or just "null", when referring to a pointer value that happens to be null and to reserve "nullptr" for *statically* null pointers, especially the `nullptr` expression. If the poin

[PATCH] D43430: Omit nullptr check for sufficiently simple delete-expressions

2018-02-18 Thread Andrew Hunter via Phabricator via cfe-commits
ahh updated this revision to Diff 134846. ahh added a comment. Fix indentation Repository: rC Clang https://reviews.llvm.org/D43430 Files: lib/CodeGen/CGCXXABI.h lib/CodeGen/CGExprCXX.cpp test/CodeGenCXX/cxx2a-destroying-delete.cpp test/CodeGenCXX/delete-two-arg.cpp test/CodeGenCXX

[PATCH] D43430: Omit nullptr check for sufficiently simple delete-expressions

2018-02-18 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. LGTM, but I'd also like @rjmccall's opinion. Repository: rC Clang https://reviews.llvm.org/D43430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43430: Omit nullptr check for sufficiently simple delete-expressions

2018-02-18 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D43430#1011269, @kimgr wrote: > I wonder if this could have negative effects for frequent deletion of > nullptrs (e.g. a sometimes-allocated member of a heavily used value type). For that to be better, I think we'd need one of two things to h

Re: [PATCH] D43430: Omit nullptr check for sufficiently simple delete-expressions

2018-02-18 Thread Andrew Hunter via cfe-commits
On Sat, Feb 17, 2018 at 1:41 AM Kim Gräsman via Phabricator < revi...@reviews.llvm.org> wrote: > kimgr added a comment. > > Peanut gallery observation: there was a discussion on the Boost list years > and years ago where someone made the case that `if (x != nullptr) delete > x;` was measurably fas

[PATCH] D43430: Omit nullptr check for sufficiently simple delete-expressions

2018-02-17 Thread Kim Gräsman via Phabricator via cfe-commits
kimgr added a comment. Peanut gallery observation: there was a discussion on the Boost list years and years ago where someone made the case that `if (x != nullptr) delete x;` was measurably faster than just calling `delete x;` I can't find it now, but I think it might have been in the context o

[PATCH] D43430: Omit nullptr check for sufficiently simple delete-expressions

2018-02-17 Thread Andrew Hunter via Phabricator via cfe-commits
ahh added a comment. On my workstation's checkout of head, one test fails (Clang :: Driver/response-file.c) both with and without this change; everything else appears to pass. I believe that between the tests I add to delete.cpp and the ones that are already there (and destroying-delete.cpp) w

[PATCH] D43430: Omit nullptr check for sufficiently simple delete-expressions

2018-02-17 Thread Andrew Hunter via Phabricator via cfe-commits
ahh created this revision. ahh added a reviewer: rsmith. Herald added a subscriber: cfe-commits. [expr.delete] is pretty crystal clear that it's OK to invoke a deallocation-function on a nullptr delete-expression: "If the value of the operand of the delete-expression is a null pointer value, it i