From 066c89d1e1c509975a0e76be4279e2505084bd3b Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 17 Nov 2020 10:07:25 -0800 Subject: [PATCH] global trees This reorders the common and c++ global tree arrays. It introduces a module-specific High Water Mark, below which are the immutable slots initialized at startup and beyond which are the lazily filled slots (and a few immutables we need to locate by name lookup anyway). gcc/c-family/ * c-common.h (enum c_tree_index): Reorder to place lazy fields after newly-added CTI_MODULE_HWM. gcc/cp/ * cp-tree.h (enum cp_tree_index): Reorder to place lazy fields after newly-added CPTI_MODULE_HWM. --- gcc/c-family/c-common.h | 8 ++++++-- gcc/cp/cp-tree.h | 31 ++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index 3c508979b14..f413e8773f5 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -364,13 +364,17 @@ enum c_tree_index CTI_DEFAULT_FUNCTION_TYPE, + CTI_NULL, + /* These are not types, but we have to look them up all the time. */ CTI_FUNCTION_NAME_DECL, CTI_PRETTY_FUNCTION_NAME_DECL, CTI_C99_FUNCTION_NAME_DECL, - CTI_SAVED_FUNCTION_NAME_DECLS, - CTI_NULL, + CTI_MODULE_HWM, + /* Below here entities change during compilation. */ + + CTI_SAVED_FUNCTION_NAME_DECLS, CTI_MAX }; diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 9ae6ff5f7a2..81485de94f9 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -128,12 +128,8 @@ enum cp_tree_index CPTI_EXPLICIT_VOID_LIST, CPTI_VTBL_TYPE, CPTI_VTBL_PTR_TYPE, - CPTI_STD, - CPTI_ABI, CPTI_GLOBAL, CPTI_GLOBAL_TYPE, - CPTI_CONST_TYPE_INFO_TYPE, - CPTI_TYPE_INFO_PTR_TYPE, CPTI_ABORT_FNDECL, CPTI_AGGR_TAG, CPTI_CONV_OP_MARKER, @@ -190,8 +186,28 @@ enum cp_tree_index CPTI_NOEXCEPT_FALSE_SPEC, CPTI_NOEXCEPT_DEFERRED_SPEC, + CPTI_NULLPTR, + CPTI_NULLPTR_TYPE, + + CPTI_ANY_TARG, + + CPTI_MODULE_HWM, + /* Nodes after here change during compilation, or should not be in + the module's global tree table. */ + + /* We must find these via the global namespace. */ + CPTI_STD, + CPTI_ABI, + + /* These are created at init time, but the library/headers provide + definitions. */ + CPTI_ALIGN_TYPE, + CPTI_CONST_TYPE_INFO_TYPE, + CPTI_TYPE_INFO_PTR_TYPE, CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN, + + /* These are lazily inited. */ CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN, @@ -204,13 +220,6 @@ enum cp_tree_index CPTI_DSO_HANDLE, CPTI_DCAST, - CPTI_NULLPTR, - CPTI_NULLPTR_TYPE, - - CPTI_ALIGN_TYPE, - - CPTI_ANY_TARG, - CPTI_SOURCE_LOCATION_IMPL, CPTI_FALLBACK_DFLOAT32_TYPE, -- 2.30.2