================
@@ -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;
----------------
erichkeane wrote:
Another thing: @zygoloid mentioned on another thread that there were bits we
should/could steal back from constructors.
I wonder if we could look through any of ours and do the reverse: switch it to
a map. I find myself wondering how often 'used/referenced' is actually
meaningfully used. I suspect it is JUST for a certain diagnostic, plus 1x in
codegen. Both of which are pretty rare lookups. (compared to 'invalid', which
gets looked up constantly).
`Implicit` might be something we could steal back, I think we only check that
occasionally. `TopLevelDeclInObjCContainer` I have no knowledge of, so we
could very likely evaluate if that is looked up often enough to matter (OR is
only used on a sub-type?).
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?
https://github.com/llvm/llvm-project/pull/219138
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits