[PATCH] D102820: [Clang] Check for returns_nonnull when deciding to add allocation null checks

2021-06-23 Thread Di Mo via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG42b99e094c4f: [Clang] Check for returns_nonnull when deciding to add allocation null checks (authored by modimo). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D102820: [Clang] Check for returns_nonnull when deciding to add allocation null checks

2021-06-15 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
bruno accepted this revision. bruno added a comment. This revision is now accepted and ready to land. > Assuming I'm answering the correct question that the returns_nonnull is > preserved through a PCH, the answer is yes. Thanks! > As mentioned this isn't strictly needed and the BE can elide

[PATCH] D102820: [Clang] Check for returns_nonnull when deciding to add allocation null checks

2021-06-08 Thread Di Mo via Phabricator via cfe-commits
modimo added a comment. Ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102820/new/ https://reviews.llvm.org/D102820 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D102820: [Clang] Check for returns_nonnull when deciding to add allocation null checks

2021-05-26 Thread Di Mo via Phabricator via cfe-commits
modimo added a comment. @rsmith @lebedev.ri thoughts on adding this directly to FE generation? As mentioned this isn't strictly needed and the BE can elide the check but we can also not emit it to save on AST/IR processing cost. CHANGES SINCE LAST ACTION

[PATCH] D102820: [Clang] Check for returns_nonnull when deciding to add allocation null checks

2021-05-20 Thread Di Mo via Phabricator via cfe-commits
modimo added a comment. In D102820#2772184 , @bruno wrote: > Sounds reasonable to me! Can you double check whether this attribute gets > correctly serialized/deserialized in face of `CXXNewExpr`? An example of how > to test that would be in

[PATCH] D102820: [Clang] Check for returns_nonnull when deciding to add allocation null checks

2021-05-20 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
bruno added a comment. Sounds reasonable to me! Can you double check whether this attribute gets correctly serialized/deserialized in face of `CXXNewExpr`? An example of how to test that would be in `clang/test/PCH/cxx-method.cpp`. CHANGES SINCE LAST ACTION

[PATCH] D102820: [Clang] Check for returns_nonnull when deciding to add allocation null checks

2021-05-20 Thread Di Mo via Phabricator via cfe-commits
modimo added a subscriber: urnathan. modimo added a comment. Discussing with @urnathan this makes more sense for the BE to handle when optimizing by eliding the generated null check. Confirmed this is indeed the case so removing the generation in the FE isn't really needed. CHANGES SINCE LAST

[PATCH] D102820: [Clang] Check for returns_nonnull when deciding to add allocation null checks

2021-05-19 Thread Di Mo via Phabricator via cfe-commits
modimo updated this revision to Diff 346610. modimo added a comment. Go back to single statement return, fix up ATTR_BUILTIN_NOTHROW_NEW test label that pointed to nothing to correct ATTR_NOBUILTIN_NOUNWIND_ALLOCSIZE label. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102820/new/

[PATCH] D102820: [Clang] Check for returns_nonnull when deciding to add allocation null checks

2021-05-19 Thread Di Mo via Phabricator via cfe-commits
modimo created this revision. modimo added reviewers: bruno, lebedev.ri, rsmith. Herald added subscribers: hoy, wenlei, lxfind. modimo requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Non-throwing allocators currently will always get