[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-08 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/test/CodeGen/attr-counted-by.c:2 +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 3 +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2 -Wall

[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-08 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. I changed more than just the testcase (not a lot, but non-trivial nonetheless). PTAL. Comment at: clang/test/CodeGen/attr-counted-by.c:2 +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 3 +// RUN:

[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-08 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 556312. void marked an inline comment as done. void added a comment. Remove unneded extern decl from test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148381/new/ https://reviews.llvm.org/D148381 Files:

[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-08 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 556310. void added a comment. - Expand test to show the unsanitized version, - Unify the ways of finding a specific field based on a predicate, - Make sure we're using the correct types in a couple of key places. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Patch LGTM; just want moar tests. --- Mind adding a test for #if !__has_attribute(counted_by) #error "has attribute broken" #endif Comment at: clang/test/CodeGen/attr-counted-by.c:2 +// NOTE: Assertions have been autogenerated by

[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-06 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D148381#4639909 , @kees wrote: > I can generate warnings for anonymous structs were the `__counted_by` member > is reported as "not found". For example: > > little.c:7:28: warning: counted_by field 'count' not found > 7

[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-06 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. I can generate warnings for anonymous structs were the `__counted_by` member is reported as "not found". For example: little.c:7:28: warning: counted_by field 'count' not found 7 | int array[] __counted_by(count); |

[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-06 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. In D148381#4639436 , @xbolva00 wrote: > Will gcc use counted_by or element_count ? GCC is using `__counted_by`: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628459.html Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-06 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. Will gcc use counted_by or element_count ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148381/new/ https://reviews.llvm.org/D148381 ___ cfe-commits mailing list

[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-06 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. This is now ready for a non-WIP review. PTAL. :-) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148381/new/ https://reviews.llvm.org/D148381 ___ cfe-commits mailing list

[PATCH] D148381: [Clang] Add counted_by attribute

2023-09-05 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 555946. void added a comment. Update documentation. Cribbed off of Qing Zhao's GCC implementation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148381/new/ https://reviews.llvm.org/D148381 Files: