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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
15 matches
Mail list logo