[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-06-10 Thread Leonard Chan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2f6bb2a69215: [clang][Attribute] Fix noderef attribute false-negatives (authored by leonardchan). Changed prior to commit: https://reviews.llvm.org/D77836?vs=267684&id=269951#toc Repository: rG LLVM

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-06-09 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. Lemme know if there's any more feedback. Will aim for committing this sometime at the end of the day. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77836/new/ https://reviews.llvm.org/D77836

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-06-01 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 267684. leonardchan added a comment. Rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77836/new/ https://reviews.llvm.org/D77836 Files: clang/include/clang/Sema/Initialization.h clang/lib/Sema/Sem

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-05-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM, but please wait for a few days in case @rsmith has further concerns. Comment at: clang/lib/Sema/SemaInit.cpp:8182 !ToPtrType->getPointeeTyp

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-05-28 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. *ping* Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77836/new/ https://reviews.llvm.org/D77836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-05-01 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 261519. leonardchan marked 6 inline comments as done. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77836/new/ https://reviews.llvm.org/D77836 Files: clang/include/clang/Sema/Initialization.h clang/lib/S

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-05-01 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: clang/lib/Sema/SemaCast.cpp:2557-2558 return; +CheckNoDeref(Self, SrcExpr.get()->getType(), ResultType, + OpRange.getBegin()); } rsmith wrote: > Should we be checking thi

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-04-24 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaCast.cpp:734 void CastOperation::CheckDynamicCast() { + CheckNoDerefRAII noderef_check(*this); + Please use UpperCamelCase for local variables. Comment at: clang/lib/Sema/SemaCast.c

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-04-14 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 257419. leonardchan added a comment. Rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77836/new/ https://reviews.llvm.org/D77836 Files: clang/include/clang/Sema/Initialization.h clang/lib/Sema/Sem

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-04-13 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 257153. leonardchan marked an inline comment as done. leonardchan added a comment. Updated to address comments and added an RAII class for easier checking before exiting functions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-04-13 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:8182-8184 +// Do not check static casts here because they are checked earlier +// in Sema::ActOnCXXNamedCast() +if (!Kind.isStaticCast()) { leonardchan

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-04-13 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked 3 inline comments as done. leonardchan added inline comments. Comment at: clang/lib/Sema/SemaCast.cpp:264 + CheckNoderef(*this, E->getType(), TInfo->getType(), OpLoc); + rsmith wrote: > Warning on this seems reasonable for `static_cast` and

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-04-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Frontend/noderef.c:211 + +int *implicit_cast(NODEREF int *x) { + return (int *)x; // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} The name of the function is a bit

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-04-11 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaCast.cpp:264 + CheckNoderef(*this, E->getType(), TInfo->getType(), OpLoc); + Warning on this seems reasonable for `static_cast` and `dynamic_cast`, but should `reinterpret_cast` (or the `reinterpret

[PATCH] D77836: [Attribute] Fix noderef attribute false-negatives

2020-04-09 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: rsmith, aaron.ballman. leonardchan added a project: clang. `noderef` was failing to trigger warnings in some cases related to c++ style casting. This patch addresses them. Repository: rG LLVM Github Monorepo https://reviews.llvm