================
@@ -1161,10 +1161,13 @@ class Parser : public CodeCompletionHandler {
     IdentifierInfo *MacroII = nullptr;
     SourceLocation AttrNameLoc;
     SmallVector<Decl *, 2> Decls;
+    unsigned NestedTypeLevel;
----------------
rapidsna wrote:

I agree bounds safety attributes are the only type attributes that need late 
parsing right now. That said, any late-parsed type attribute needs to know its 
position in the type tree, so tracking this seems inherent to the feature—not 
bounds-safety specific.

IOW, even if we stored both QualTypes and walked between them like you 
suggested, we'd still need that position-calculating logic for any 
`LateParsedTypeAttribute`.

> But because we're expanding the capabilities here... Do we want 
> LateParsedDeclAttribute and LateParsedTypeAttribute with the common stuff in 
> a base class? Do we want a discriminated union in LatestParsedAttribute so 
> only one of the decls, type, (or eventually smt) is valid at a time? My 
> concern with the current approach is that it's unclear which fields are 
> actually used under what circumstances,. e.g., you can get a 
> LatedParsedAttribute which sets PointerIndirectionLevel but is actually for a 
> declaration attribute rather than a type attribute.

This makes sense to me. I can try `LateParsedDeclAttribute` and 
`LateParsedTypeAttribute` with the common stuff in a base class.

https://github.com/llvm/llvm-project/pull/166491
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to