[clang] [BoundsSafety] Support late parsing for `counted_by` in type positions (PR #166491)
Yeoul Na via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 7 07:44:43 PST 2025
================
@@ -1238,6 +1238,9 @@ struct DeclaratorChunk {
ParsedAttributesView AttrList;
+ using LateAttrListTy = SmallVector<void *, 1>;
----------------
rapidsna wrote:
This tracks pointers to `Parser::LateParsedAttribute`, a member struct of `class Parser` defined in `Parser.h`.
I couldn't include `Parser.h` because of circular dependencies. I also looked at a few other options:
- Duplicating the type in DeclSpec.h — In downstream, we created another struct called `LateParsedAttrInfo` in `DeclSpec.h`, but it's essentially a duplicate of `Parser::LateParsedAttribute`, so I don't think that's the right approach.
- Forward declaring `Parser::LateParsedAttribute` — Can't do it since it's a nested member struct.
- Hoisting `LateParsedAttribute` out of class Parser — It inherits from `Parser::LateParsedDeclaration`, which is inherited by multiple other member structs and referenced all over the codebase. That would require too invasive changes.
I can still create a type alias to make it more readable:
`using LateAttrOpaquePtr = void*;`
Would that work for you?
https://github.com/llvm/llvm-project/pull/166491
More information about the cfe-commits
mailing list