aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.cc
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2022-11-18 05:05:03 +0000
committerAndrew Pinski <apinski@marvell.com>2022-11-19 17:09:57 +0000
commit5c021f17e7d09a0eae2d6fb875c9a5484bd4e043 (patch)
tree8874a8f9368ec8857ce28d2ce6d886fa1fafc7da /gcc/tree.cc
parent18169e8eee1887cdd200897c30ac26bec8721729 (diff)
downloadgcc-5c021f17e7d09a0eae2d6fb875c9a5484bd4e043.zip
gcc-5c021f17e7d09a0eae2d6fb875c9a5484bd4e043.tar.gz
gcc-5c021f17e7d09a0eae2d6fb875c9a5484bd4e043.tar.bz2
constexprify some tree variables
Since we use C++11 by default now, we can use constexpr for some const decls in tree-core.h. This patch does that and it allows for better optimizations of GCC code with checking enabled and without LTO. For an example generic-match.cc compiling is speed up due to the less number of basic blocks and less debugging info produced. I did not check the speed of compiling the same source but rather the speed of compiling the old vs new sources here (but with the same compiler base). The small slow down in the parsing of the arrays in each TU is migrated by a speed up in how much code/debugging info is produced in the end. Note I looked at generic-match.cc since it is one of the compiling sources which causes parallel building to stall and I wanted to speed it up. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR middle-end/14840 * tree-core.h (tree_code_type): Constexprify by including all-tree.def. (tree_code_length): Likewise. * tree.cc (tree_code_type): Remove. (tree_code_length): Remove.
Diffstat (limited to 'gcc/tree.cc')
-rw-r--r--gcc/tree.cc24
1 files changed, 0 insertions, 24 deletions
diff --git a/gcc/tree.cc b/gcc/tree.cc
index 574bd2e..254b237 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -74,31 +74,7 @@ along with GCC; see the file COPYING3. If not see
#include "asan.h"
#include "ubsan.h"
-/* Tree code classes. */
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-#define END_OF_BASE_TREE_CODES tcc_exceptional,
-
-const enum tree_code_class tree_code_type[] = {
-#include "all-tree.def"
-};
-
-#undef DEFTREECODE
-#undef END_OF_BASE_TREE_CODES
-
-/* Table indexed by tree code giving number of expression
- operands beyond the fixed part of the node structure.
- Not used for types or decls. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
-#define END_OF_BASE_TREE_CODES 0,
-
-const unsigned char tree_code_length[] = {
-#include "all-tree.def"
-};
-
-#undef DEFTREECODE
-#undef END_OF_BASE_TREE_CODES
/* Names of tree components.
Used for printing out the tree and error messages. */