================
@@ -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;
----------------
AaronBallman wrote:
> I find myself wondering how often 'used/referenced' is actually meaningfully
> used.
It's not used broadly across the compiler but it is used often in terms of how
often it's referenced (basically every named declaration has some sort of
`-Wunused` interactions), but whether we need it as a bit in `DeclBase` is
something we could measure. But I don't want to turn this into a massive
research rabbit hole for @steffenlarsen :-D
> 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 *think* that may be fine, but I think it would make sense to measure common
declaration nodes to see how their size changes. e.g., if this makes `VarDecl`
or `FunctionDecl` (etc) suddenly jump in size, that could be problematic for
this patch.
https://github.com/llvm/llvm-project/pull/219138
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits