[clang] [clang-tools-extra] [Clang][AST] Introduce `ExplicitInstantiationDecl` to preserve source info and fix diagnostic locations (PR #191658)

via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 18 10:24:35 PDT 2026


16bit-ykiko wrote:

> > > I think this is a good direction, we should probably alert our downstreams @llvm/clang-vendors to make sure they are comfortable with the new node/having to deal with the new node in AST searches.
> > > We should probably make sure our AST-matchers has a way of seeing these?
> > > Also: I'm a bit concerned about the additional memory pressure, the `ExplicitInstantiationDecl` is pretty huge. Can we measure the difference in memory usage in some sort of major project here to see?
> > > I'm also interested in if this has a sizable negative effect on compile times, we have the tracker, but I don't recall how to start it (@Endilll ?).
> > 
> > 
> > After optimization, this class is now quite small. In my experience, explicit instantiations are rarely used in codebases anyway, meaning very few of these nodes will actually be created. Therefore, I believe the impact on compile time will likely be negligible.
> 
> Still worth running the check benchmark though. I hope few of these nodes will be created, but we don't know what we don't know! There could likely be a pathological case here we're not thinking about.

Hi, here are the test results. It seems nikic has been busy recently, so I asked someone else with the necessary permissions to help run the tests. It looks like the impact on compile time is negligible—only a few hundredths of a percent (around 0.0x%).

https://llvm-compile-time-tracker.com/compare.php?from=4fb21a1d226bff588a66b51452a159b41c5373d5&to=ee2fc2ee0c6d96457339ddd073dde107e7369aff&stat=instructions:u

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


More information about the cfe-commits mailing list