[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-20 Thread Dan Liew via cfe-commits
delcypher wrote: I'll put up a new version of this PR with the memory leak fixed soon. https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-18 Thread Dan Liew via cfe-commits
delcypher wrote: Ok. Now I see what's happening. These lines here are basically giving ownership of `LateParsedAttribute` to the `LateParsedAttrList` ``` // Handle attributes with arguments that require late parsing. LateParsedAttribute *LA = new

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Dan Liew via cfe-commits
delcypher wrote: The leak via `clang::Parser::ParseLexedCAttribute` is ```c++ LA.Toks.push_back(AttrEnd); ``` and the leak via `clang::Parser::ParseGNUAttributes` is ``` LateParsedAttribute *LA = new LateParsedAttribute(this, *AttrName, AttrNameLoc); ``` which is really

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Dan Liew via cfe-commits
delcypher wrote: Hmm. Apparently there's a memory leak. https://lab.llvm.org/buildbot/#/builders/239/builds/7043 ``` -- Testing: 79948 of 79949 tests, 48 workers -- Testing: FAIL: Clang :: AST/attr-counted-by-late-parsed-struct-ptrs.c (480 of 79948) TEST 'Clang ::

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Bill Wendling via cfe-commits
bwendling wrote: Thank you. I wrote to the author. I hope he'll be able to come up with a change on his end. Or at least an explanation that makes sense :-) https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits mailing list

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Dan Liew via cfe-commits
delcypher wrote: @kees @bwendling @rapidsna The workaround to downgrade this error to a warning has landed https://github.com/llvm/llvm-project/commit/cef6387e52578366c2332275dad88b9953b55336 https://github.com/llvm/llvm-project/pull/90786 ___

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Bill Wendling via cfe-commits
bwendling wrote: Ah! I see what you mean. I'll bring this up with the developer. (Actually, that construct makes me nervous about their code in general...) https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits mailing list

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Dan Liew via cfe-commits
delcypher wrote: @bwendling This is unfortunate ``` drivers/gpu/drm/radeon/pptable.h:442:5: error: 'counted_by' cannot be applied to an array with element of unknown size because 'ATOM_PPLIB_STATE_V2' (aka 'struct _ATOM_PPLIB_STATE_V2') is a struct type with a flexible array member 442 |

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Yeoul Na via cfe-commits
rapidsna wrote: @bwendling @kees Likely, we should not put `__counted_by` in that case. Could we fix the source? https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Yeoul Na via cfe-commits
rapidsna wrote: @bwendling @kees Wait. `ATOM_PPLIB_STATE_V2` is also a struct with flexible array member? This is concerning because `ucNumEntries * sizeof(ATOM_PPLIB_STATE_V2)` is not the correct size anyway. Do you know the semantics of this structure?

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Yeoul Na via cfe-commits
rapidsna wrote: @bwendling Thanks for reporting. We will relax the restrictions for arrays to not break the existing users. https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Bill Wendling via cfe-commits
bwendling wrote: This seems to have broken the Linux build: https://github.com/llvm/llvm-project/commit/0ec3b972e58bcbcdc1bebe1696ea37f2931287c3 breaks the build for Linux, added by https://git.kernel.org/linus/781d41fed19caf900c8405064676813dc9921d32:

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Dan Liew via cfe-commits
delcypher wrote: Test fixed by `112eadd55f06bee15caadff688ea0b45acbfa804`. https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Dan Liew via cfe-commits
delcypher wrote: Looks like I broke the `clang/test/Misc/pragma-attribute-supported-attributes-list.test` test. I'll push a follow up fix to that test once I've confirmed I've fixed it. https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Dan Liew via cfe-commits
https://github.com/delcypher closed https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Dan Liew via cfe-commits
https://github.com/delcypher updated https://github.com/llvm/llvm-project/pull/90786 >From 80dbab4c4b43eb78f29b7b8fa577f04772a7f52c Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Wed, 1 May 2024 13:56:52 -0700 Subject: [PATCH] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-17 Thread Dan Liew via cfe-commits
delcypher wrote: @kees Thanks for approving. I'm going to resolve the merge conflict in `clang/docs/ReleaseNotes.rst` and then merge. I'll start looking at supporting `__counted_by()` on incomplete pointee types next. @hnrklssn is going to start working on upstreaming the `__sized_by`

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-15 Thread Dan Liew via cfe-commits
https://github.com/delcypher updated https://github.com/llvm/llvm-project/pull/90786 >From e6fb7a3374ada3d02b4c89263ffd14a037a7e56a Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Wed, 1 May 2024 13:56:52 -0700 Subject: [PATCH] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-14 Thread Kees Cook via cfe-commits
https://github.com/kees approved this pull request. Thanks for the updates! Let's get this in and continue with the rest of the support. :) https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-14 Thread Dan Liew via cfe-commits
delcypher wrote: @bwendling @kees Any further feedback? If not, can you approve? As @rapidsna said we'll follow up this PR with additional PRs to address the two major concerns you had. https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-14 Thread Dan Liew via cfe-commits
@@ -0,0 +1,187 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +#define __counted_by(f) __attribute__((counted_by(f))) + +struct bar; + +struct not_found { + int count; + struct bar *fam[] __counted_by(bork); // expected-error {{use of undeclared identifier 'bork'}} +}; +

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-14 Thread Dan Liew via cfe-commits
https://github.com/delcypher updated https://github.com/llvm/llvm-project/pull/90786 >From 1f4d924768409d6bc61d160c6161e6acebf62b60 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Wed, 1 May 2024 13:56:52 -0700 Subject: [PATCH 1/4] [BoundsSafety] Allow 'counted_by' attribute on pointers in

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-13 Thread Bill Wendling via cfe-commits
bwendling wrote: > > It's not a lie, because the contents of a pointer don't contribute to the > > size of the struct containing that pointer. > > Consider this example. It tries to illustrate why putting `__counted_by()` on > a pointer to a structs containing flexible array members doesn't

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-13 Thread Yeoul Na via cfe-commits
rapidsna wrote: > The main concern I have with delaying support for this is that header files > could find themselves in a state where they could not be refactored without > removing counted_by attributes that refer to now-incomplete structs. @kees Agreed. We will work on a follow up patch to

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-11 Thread Kees Cook via cfe-commits
@@ -0,0 +1,187 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +#define __counted_by(f) __attribute__((counted_by(f))) + +struct bar; + +struct not_found { + int count; + struct bar *fam[] __counted_by(bork); // expected-error {{use of undeclared identifier 'bork'}} +}; +

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-11 Thread Kees Cook via cfe-commits
kees wrote: > Consider this example. It tries to illustrate why putting `__counted_by()` on > a pointer to a structs containing flexible array members doesn't make sense. > > ```c > struct HasFAM { > int count; > char buffer[] __counted_by(count); // This is OK > }; > > struct

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-10 Thread Dan Liew via cfe-commits
delcypher wrote: > It's not a lie, because the contents of a pointer don't contribute to the > size of the struct containing that pointer. Consider this example. It tries to illustrate why putting `__counted_by()` on a pointer to a structs containing flexible array members doesn't make sense.

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-10 Thread Kees Cook via cfe-commits
kees wrote: > As @apple-fcloutier @rapidsna noted this is how `-fbounds-safety` is > currently implemented (because its much simpler) but it is a restriction that > could be lifted in future by only requiring `struct bar` to be defined at the > point that `foo::bar` is used rather than when

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-10 Thread Dan Liew via cfe-commits
delcypher wrote: > @rapidsna @delcypher @apple-fcloutier @kees: > > Okay, I think I see what the complication is. Are you trying to prevent the > use case of someone writing something like: > > ```c > struct bar; > > struct foo { > size_t count; > struct bar *ptr __counted_by(count); >

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-10 Thread Bill Wendling via cfe-commits
bwendling wrote: @rapidsna @delcypher @apple-fcloutier @kees: Okay, I think I see what the complication is. Are you trying to prevent the use case of someone writing something like: ```c struct bar; struct foo { size_t count; struct bar *ptr __counted_by(count); }; ``` where `ptr` is a

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-10 Thread Bill Wendling via cfe-commits
bwendling wrote: @apple-fcloutier: > think that there's room to allow `__counted_by` on incomplete types so that a > TU where it's complete could use it (and we have use cases where that would > be handy), but our implementation doesn't support it at this time. This can > be added without

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-09 Thread Yeoul Na via cfe-commits
rapidsna wrote: > I've been thinking about this restriction. Why is this necessary? My > assumption was that applying counted_by to a pointer causes a bounds check on > an index into the pointer rather than its underlying type. @bwendling It's because these types are not indexable really.

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-09 Thread Dan Liew via cfe-commits
delcypher wrote: @bwendling > I've been thinking about this restriction. Why is this necessary? My > assumption was that applying counted_by to a pointer causes a bounds check on > an index into the pointer rather than its underlying type. @rapidsna Please add additional points if I

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-09 Thread via cfe-commits
apple-fcloutier wrote: I think that there's room to allow `__counted_by` on incomplete types so that a TU where it's complete could use it (and we have use cases where that would be handy), but our implementation doesn't support it at this time. This can be added without disruptions at a

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-09 Thread Bill Wendling via cfe-commits
bwendling wrote: > Note the attribute is prevented on pointee types where the size isn't known > at compile time. In particular pointee types that are: > > * Incomplete (e.g. `void`) and sizeless types > * Function types (e.g. the pointee of a function pointer) > * Struct types with a flexible

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
@@ -335,6 +336,22 @@ Attribute Changes in Clang - Clang now warns that the ``exclude_from_explicit_instantiation`` attribute is ignored when applied to a local class or a member thereof. +- The ``counted_by`` attribute can now be late parsed in C when

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Dan Liew via cfe-commits
@@ -335,6 +336,22 @@ Attribute Changes in Clang - Clang now warns that the ``exclude_from_explicit_instantiation`` attribute is ignored when applied to a local class or a member thereof. +- The ``counted_by`` attribute can now be late parsed in C when

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
@@ -6534,6 +6536,15 @@ def err_counted_by_attr_refer_to_union : Error< "'counted_by' argument cannot refer to a union member">; def note_flexible_array_counted_by_attr_field : Note< "field %0 declared here">; +def err_counted_by_attr_pointee_unknown_size : Error< +

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
@@ -631,6 +631,18 @@ bool Type::isStructureType() const { return false; } +bool Type::isStructureTypeWithFlexibleArrayMember() const { + const auto *RT = getAs(); + if (!RT) +return false; + const auto *Decl = RT->getDecl(); + if (!Decl->isStruct()) +return

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Dan Liew via cfe-commits
@@ -6534,6 +6536,15 @@ def err_counted_by_attr_refer_to_union : Error< "'counted_by' argument cannot refer to a union member">; def note_flexible_array_counted_by_attr_field : Note< "field %0 declared here">; +def err_counted_by_attr_pointee_unknown_size : Error< +

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
@@ -6534,6 +6536,15 @@ def err_counted_by_attr_refer_to_union : Error< "'counted_by' argument cannot refer to a union member">; def note_flexible_array_counted_by_attr_field : Note< "field %0 declared here">; +def err_counted_by_attr_pointee_unknown_size : Error< +

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
@@ -335,6 +336,22 @@ Attribute Changes in Clang - Clang now warns that the ``exclude_from_explicit_instantiation`` attribute is ignored when applied to a local class or a member thereof. +- The ``counted_by`` attribute can now be late parsed in C when

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Dan Liew via cfe-commits
https://github.com/delcypher updated https://github.com/llvm/llvm-project/pull/90786 >From 1f4d924768409d6bc61d160c6161e6acebf62b60 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Wed, 1 May 2024 13:56:52 -0700 Subject: [PATCH 1/3] [BoundsSafety] Allow 'counted_by' attribute on pointers in

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Dan Liew via cfe-commits
@@ -631,6 +631,18 @@ bool Type::isStructureType() const { return false; } +bool Type::isStructureTypeWithFlexibleArrayMember() const { + const auto *RT = getAs(); + if (!RT) +return false; + const auto *Decl = RT->getDecl(); + if (!Decl->isStruct()) +return

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Dan Liew via cfe-commits
@@ -6534,6 +6536,15 @@ def err_counted_by_attr_refer_to_union : Error< "'counted_by' argument cannot refer to a union member">; def note_flexible_array_counted_by_attr_field : Note< "field %0 declared here">; +def err_counted_by_attr_pointee_unknown_size : Error< +

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Dan Liew via cfe-commits
@@ -335,6 +336,22 @@ Attribute Changes in Clang - Clang now warns that the ``exclude_from_explicit_instantiation`` attribute is ignored when applied to a local class or a member thereof. +- The ``counted_by`` attribute can now be late parsed in C when

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Dan Liew via cfe-commits
https://github.com/delcypher updated https://github.com/llvm/llvm-project/pull/90786 >From 1f4d924768409d6bc61d160c6161e6acebf62b60 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Wed, 1 May 2024 13:56:52 -0700 Subject: [PATCH 1/2] [BoundsSafety] Allow 'counted_by' attribute on pointers in

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
https://github.com/bwendling edited https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
@@ -3282,6 +3282,19 @@ void Parser::ParseAlignmentSpecifier(ParsedAttributes , } } +void Parser::DistributeCLateParsedAttrs(Decl *Dcl, +LateParsedAttrList *LateAttrs) { + assert(Dcl); bwendling wrote: Could you add

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
@@ -8588,31 +8588,71 @@ static const RecordDecl *GetEnclosingNamedOrTopAnonRecord(const FieldDecl *FD) { return RD; } -static bool -CheckCountExpr(Sema , FieldDecl *FD, Expr *E, - llvm::SmallVectorImpl ) { +enum class CountedByInvalidPointeeTypeKind { +

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
@@ -631,6 +631,18 @@ bool Type::isStructureType() const { return false; } +bool Type::isStructureTypeWithFlexibleArrayMember() const { + const auto *RT = getAs(); + if (!RT) +return false; + const auto *Decl = RT->getDecl(); + if (!Decl->isStruct()) +return

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
@@ -6534,6 +6536,15 @@ def err_counted_by_attr_refer_to_union : Error< "'counted_by' argument cannot refer to a union member">; def note_flexible_array_counted_by_attr_field : Note< "field %0 declared here">; +def err_counted_by_attr_pointee_unknown_size : Error< +

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Bill Wendling via cfe-commits
@@ -335,6 +336,22 @@ Attribute Changes in Clang - Clang now warns that the ``exclude_from_explicit_instantiation`` attribute is ignored when applied to a local class or a member thereof. +- The ``counted_by`` attribute can now be late parsed in C when

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-03 Thread Dan Liew via cfe-commits
@@ -8588,31 +8588,71 @@ static const RecordDecl *GetEnclosingNamedOrTopAnonRecord(const FieldDecl *FD) { return RD; } -static bool -CheckCountExpr(Sema , FieldDecl *FD, Expr *E, - llvm::SmallVectorImpl ) { +enum class CountedByInvalidPointeeTypeKind { +

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-02 Thread Henrik G. Olsson via cfe-commits
@@ -8588,31 +8588,71 @@ static const RecordDecl *GetEnclosingNamedOrTopAnonRecord(const FieldDecl *FD) { return RD; } -static bool -CheckCountExpr(Sema , FieldDecl *FD, Expr *E, - llvm::SmallVectorImpl ) { +enum class CountedByInvalidPointeeTypeKind { +

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good to me. https://github.com/llvm/llvm-project/pull/90786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Dan Liew (delcypher) Changes Previously the attribute was only allowed on flexible array members. This patch patch changes this to also allow the attribute on pointer fields in structs and also allows late parsing of the attribute in

[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-01 Thread Dan Liew via cfe-commits
https://github.com/delcypher created https://github.com/llvm/llvm-project/pull/90786 Previously the attribute was only allowed on flexible array members. This patch patch changes this to also allow the attribute on pointer fields in structs and also allows late parsing of the attribute in