[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 22 09:29:46 PDT 2024


AaronBallman wrote:

> My feeling is that it's not worth the complexity. Getting an accurate benchmak would be difficult, it would only manifest in extremely templated code I wonder if @AaronBallman has opinion.

I think the complexity may be worth it -- FWIW, this originally came from https://github.com/llvm/llvm-project/commit/6163aa96799cbad7f2f58e02c5bebee9647056a5. CC @zygoloid for opinions as the original author.

One question I have is whether it would make sense to modify `DestroyTemplateIdAnnotationsRAIIObj` to not call `MaybeDestroyTemplateIds()` in the first place, rather than add a new RAII object that early returns from `MaybeDestroyTemplateIds()`> so that the logic is more self-contained?

https://github.com/llvm/llvm-project/pull/89494


More information about the cfe-commits mailing list