diff options
author | Nathan Sidwell <nathan@acm.org> | 2022-09-28 09:20:27 -0700 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2022-09-28 13:43:07 -0700 |
commit | 9f65eecdbef6027722e93aadf3fa6b3cc342eb4f (patch) | |
tree | f48eebe3d44d85a5326b75a3a609ebc0b3a8c5fb /gcc/cp/cp-tree.h | |
parent | db288230db55dc1ff626f46c708b555847013a41 (diff) | |
download | gcc-9f65eecdbef6027722e93aadf3fa6b3cc342eb4f.zip gcc-9f65eecdbef6027722e93aadf3fa6b3cc342eb4f.tar.gz gcc-9f65eecdbef6027722e93aadf3fa6b3cc342eb4f.tar.bz2 |
c++: Add DECL_NTTP_OBJECT_P lang flag
VAR_DECLs for NTTPs need to be handled specially by module streaming,
in the same manner to type info decls. This reworks their handling to
allow that work to drop in. We use DECL_LANG_FLAG_5 to indicate such
decls (I didn't notice template_parm_object_p, which looks at the
mangled name -- anyway a bit flag on the node is better, IMHO). We
break apart the creation routine, so there's now an entry point the
module machinery can use directly.
gcc/cp/
* cp-tree.h (DECL_NTTP_OBJECT_P): New.
(template_parm_object_p): Delete.
(build_template_parm_object): Declare.
* cxx-pretty-print.cc (pp_cx_template_argument_list): Use DECL_NTTP_OBJECT_P.
* error.cc (dump_simple_decl): Likewise.
* mangle.cc (write_template_arg): Likewise.
* pt.cc (template_parm_object_p): Delete.
(create_template_parm_object): Separated out checking from ...
(get_template_parm_object): ... this, new external entry point.
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 19bbfbc..d0f1b18 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -518,6 +518,7 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; CALL_EXPR_REVERSE_ARGS (in CALL_EXPR, AGGR_INIT_EXPR) CONSTRUCTOR_PLACEHOLDER_BOUNDARY (in CONSTRUCTOR) OVL_EXPORT_P (in OVERLOAD) + DECL_NTTP_OBJECT_P (in VAR_DECL) 6: TYPE_MARKED_P (in _TYPE) DECL_NONTRIVIALLY_INITIALIZED_P (in VAR_DECL) RANGE_FOR_IVDEP (in RANGE_FOR_STMT) @@ -3548,6 +3549,10 @@ struct GTY(()) lang_decl { #define DECL_TINFO_P(NODE) \ TREE_LANG_FLAG_4 (TREE_CHECK2 (NODE,VAR_DECL,TYPE_DECL)) +/* true iff VAR_DECL node NODE is a NTTP object decl. */ +#define DECL_NTTP_OBJECT_P(NODE) \ + TREE_LANG_FLAG_5 (TREE_CHECK (NODE,VAR_DECL)) + /* 1 iff VAR_DECL node NODE is virtual table or VTT. We forward to DECL_VIRTUAL_P from the common code, as that has the semantics we need. But we want a more descriptive name. */ @@ -7414,7 +7419,7 @@ extern bool alias_type_or_template_p (tree); enum { nt_opaque = false, nt_transparent = true }; extern tree alias_template_specialization_p (const_tree, bool); extern tree dependent_alias_template_spec_p (const_tree, bool); -extern bool template_parm_object_p (const_tree); +extern tree get_template_parm_object (tree expr, tree mangle); extern tree tparm_object_argument (tree); extern bool explicit_class_specialization_p (tree); extern bool push_tinst_level (tree); |