c++, tree: declare some basic functions inline
commitb9ee7c6bfdbfcc722f3e4c8bd8378cccd4311740
authorPatrick Palka <ppalka@redhat.com>
Mon, 24 Apr 2023 14:33:49 +0000 (24 10:33 -0400)
committerPatrick Palka <ppalka@redhat.com>
Mon, 24 Apr 2023 14:33:49 +0000 (24 10:33 -0400)
treeb956bca919e19eabba0e3ece188d32854d8f30dc
parentb6d8e2975a9e1b9c3e839c09f265cd40426d23c1
c++, tree: declare some basic functions inline

The functions strip_array_types, is_typedef_decl, typedef_variant_p
and cp_expr_location are used throughout the C++ front end including in
some fairly hot parts (e.g. in the tsubst routines and cp_walk_subtree)
and they're small enough that the overhead of calling them out-of-line
is relatively significant.

So this patch moves their definitions into the appropriate headers to
enable inlining them.

gcc/cp/ChangeLog:

* cp-tree.h (cp_expr_location): Define here.
* tree.cc (cp_expr_location): Don't define here.

gcc/ChangeLog:

* tree.cc (strip_array_types): Don't define here.
(is_typedef_decl): Don't define here.
(typedef_variant_p): Don't define here.
* tree.h (strip_array_types): Define here.
(is_typedef_decl): Define here.
(typedef_variant_p): Define here.
gcc/cp/cp-tree.h
gcc/cp/tree.cc
gcc/tree.cc
gcc/tree.h