]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: add -fdump-lang-tinst
authorJason Merrill <jason@redhat.com>
Fri, 18 Apr 2025 13:50:04 +0000 (09:50 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 26 May 2025 13:56:27 +0000 (09:56 -0400)
commitf59ff19bc3d37f4dd159db541ed4f07efb10fcc8
tree44d56a6fd6f01fba08c1ba41371ac001f580fcd9
parentd424245c7abb2871b977ddc5c1e73b827a78ad07
c++: add -fdump-lang-tinst

This patch adds a dump with a trace of template instantiations, indented
based on the depth of recursive instantiation. -lineno adds the location
that triggered the instantiation, -details adds non-instantiation
sbustitutions.

The instantiate_pending_templates change is to avoid a bunch of entries for
reopening tinst scopes that we then don't instantiate anything with; it also
seems a bit cleaner this way.

gcc/cp/ChangeLog:

* cp-tree.h: Declare tinst_dump_id.
* cp-objcp-common.cc (cp_register_dumps): Set it.
* pt.cc (push_tinst_level_loc): Dump it.
(reopen_tinst_level): Here too.
(tinst_complete_p): New.
(instantiate_pending_templates): Don't reopen_tinst_level for
already-complete instantiations.

gcc/ChangeLog:

* doc/invoke.texi: Move C++ -fdump-lang to C++ section.
Add -fdump-lang-tinst.
gcc/cp/cp-objcp-common.cc
gcc/cp/cp-tree.h
gcc/cp/pt.cc
gcc/doc/invoke.texi