From 9f65eecdbef6027722e93aadf3fa6b3cc342eb4f Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 28 Sep 2022 09:20:27 -0700 Subject: 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. --- gcc/cp/mangle.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/cp/mangle.cc') diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc index 00d283f..1a45585 100644 --- a/gcc/cp/mangle.cc +++ b/gcc/cp/mangle.cc @@ -3672,7 +3672,7 @@ write_template_arg (tree node) } } - if (template_parm_object_p (node)) + if (TREE_CODE (node) == VAR_DECL && DECL_NTTP_OBJECT_P (node)) /* We want to mangle the argument, not the var we stored it in. */ node = tparm_object_argument (node); -- cgit v1.1