[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

[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)

[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

[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'