================
@@ -355,6 +351,13 @@ class alignas(8) Decl {
   LLVM_PREFERRED_TYPE(Linkage)
   mutable unsigned CacheValidAndLinkage : 3;
 
+  /// The attributes attached to this declaration, or null if it has none.
+  ///
+  /// This pointer is the sole record of whether the declaration has
+  /// attributes, so it must be cleared whenever the vector becomes empty.
+  /// Owned by the ASTContext that allocated it.
+  AttrVec *Attrs = nullptr;
----------------
steffenlarsen wrote:

Thanks both! Would you prefer I collect the sizes of some of the subclasses or 
are you leaning more towards this not being worth the limit on growing the 
struct further?

> But I don't want to turn this into a massive research rabbit hole for 
> @steffenlarsen :-D

I can do a bit of digging to see if I can make sense of it! 🚀 

> All that to say, I think a static_ assert to make sure these types don't 
> grow, plus the ability to 'steal' bits in the future if they are valuable 
> should be sufficient?

I like this idea. If nothing else, it makes it very explicit that contributors 
should be careful when adding new members to the classes, i.e. they'd have to 
bump the size expected for the classes, which in turn also flags the 
implications to both the contributor and reviewers.

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

Reply via email to