]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: speed up looking up the current class
authorJason Merrill <jason@redhat.com>
Wed, 9 Jun 2021 21:48:14 +0000 (17:48 -0400)
committerJason Merrill <jason@redhat.com>
Sat, 12 Jun 2021 04:58:11 +0000 (00:58 -0400)
commitc4e50e500da7692aad53a4488aff32e056149b3c
tree1893d70592702b1fa233133ec164bee1d8e1673d
parentf16f65f8364b5bf23c72a8fdbba4974ecadc5cb6
c++: speed up looking up the current class

While looking at template instantiation tracing, I noticed that we were
frequently looking up a particular class template instance while
instantiating it.  This patch shortcuts that lookup, and speeds up compiling
stdc++.h with my (checking/unoptimized) compiler by about 3%.

gcc/cp/ChangeLog:

* pt.c (lookup_template_class_1): Shortcut current_class_type.
gcc/cp/pt.c