diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-08 02:25:19 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-08 02:25:19 +0000 |
commit | ab93b49780a9c2b61f28a191aeac26d1a12c1729 (patch) | |
tree | 2137063a251419203d558c5aca764a7faac6df92 | |
parent | 77e1a5df62f18d8c32d767ea0f7de218b4622c74 (diff) |
* Make-lang.in (cp/parse.o): Depend on decl.h.
* cp-tree.h (do_decl_instantiation): Change prototype.
* parse.y: Include decl.h.
(parse_decl_instantiation): New function.
(explicit_instantiation): Use it.
* pt.c (do_decl_instantiation): Accept a DECL, not a DECLARATOR
and DECLSPECS.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55309 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/cp/Make-lang.in | 2 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/parse.y | 26 | ||||
-rw-r--r-- | gcc/cp/pt.c | 6 |
5 files changed, 33 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 72eb66033c5..d54f99db315 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2002-07-07 Mark Mitchell <mark@codesourcery.com> + + * Make-lang.in (cp/parse.o): Depend on decl.h. + * cp-tree.h (do_decl_instantiation): Change prototype. + * parse.y: Include decl.h. + (parse_decl_instantiation): New function. + (explicit_instantiation): Use it. + * pt.c (do_decl_instantiation): Accept a DECL, not a DECLARATOR + and DECLSPECS. + 2002-07-07 Roger Sayle <roger@eyesopen.com> * error.c (dump_function_name): Use DECL_TEMPLATE_RESULT for diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 104adf8d739..40d2388e0d8 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -301,7 +301,7 @@ cp/optimize.o: cp/optimize.c $(CXX_TREE_H) rtl.h integrate.h insn-config.h \ cp/mangle.o: cp/mangle.c $(CXX_TREE_H) toplev.h real.h cp/parse.o: cp/parse.c $(CXX_TREE_H) flags.h cp/lex.h except.h output.h \ - $(SYSTEM_H) toplev.h $(GGC_H) gt-cp-parse.h + cp/decl.h $(SYSTEM_H) toplev.h $(GGC_H) gt-cp-parse.h $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \ $(srcdir)/cp/parse.c $(OUTPUT_OPTION) # diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 6ce769db74c..810522cc3df 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4125,7 +4125,7 @@ extern tree tinst_for_decl PARAMS ((void)); extern void mark_decl_instantiated PARAMS ((tree, int)); extern int more_specialized PARAMS ((tree, tree, int, int)); extern void mark_class_instantiated PARAMS ((tree, int)); -extern void do_decl_instantiation PARAMS ((tree, tree, tree)); +extern void do_decl_instantiation (tree, tree); extern void do_type_instantiation PARAMS ((tree, tree, tsubst_flags_t)); extern tree instantiate_decl PARAMS ((tree, int)); extern tree get_bindings PARAMS ((tree, tree, tree)); diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index eb76810eb00..9f37a7e251e 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -36,6 +36,7 @@ Boston, MA 02111-1307, USA. */ #include "input.h" #include "flags.h" #include "cp-tree.h" +#include "decl.h" #include "lex.h" #include "c-pragma.h" /* For YYDEBUG definition. */ #include "output.h" @@ -132,6 +133,7 @@ static void check_class_key PARAMS ((tree, tree)); static tree parse_scoped_id PARAMS ((tree)); static tree parse_xref_tag (tree, tree, int); static tree parse_handle_class_head (tree, tree, tree, int, int *); +static void parse_decl_instantiation (tree, tree, tree); /* Cons up an empty parameter list. */ static inline tree @@ -1047,13 +1049,13 @@ explicit_instantiation: end_explicit_instantiation | TEMPLATE begin_explicit_instantiation typed_declspecs declarator { tree specs = strip_attrs ($3.t); - do_decl_instantiation (specs, $4, NULL_TREE); } + parse_decl_instantiation (specs, $4, NULL_TREE); } end_explicit_instantiation | TEMPLATE begin_explicit_instantiation notype_declarator - { do_decl_instantiation (NULL_TREE, $3, NULL_TREE); } + { parse_decl_instantiation (NULL_TREE, $3, NULL_TREE); } end_explicit_instantiation | TEMPLATE begin_explicit_instantiation constructor_declarator - { do_decl_instantiation (NULL_TREE, $3, NULL_TREE); } + { parse_decl_instantiation (NULL_TREE, $3, NULL_TREE); } end_explicit_instantiation | SCSPEC TEMPLATE begin_explicit_instantiation typespec ';' { do_type_instantiation ($4.t, $1, 1); @@ -1063,15 +1065,15 @@ explicit_instantiation: | SCSPEC TEMPLATE begin_explicit_instantiation typed_declspecs declarator { tree specs = strip_attrs ($4.t); - do_decl_instantiation (specs, $5, $1); } + parse_decl_instantiation (specs, $5, $1); } end_explicit_instantiation {} | SCSPEC TEMPLATE begin_explicit_instantiation notype_declarator - { do_decl_instantiation (NULL_TREE, $4, $1); } + { parse_decl_instantiation (NULL_TREE, $4, $1); } end_explicit_instantiation {} | SCSPEC TEMPLATE begin_explicit_instantiation constructor_declarator - { do_decl_instantiation (NULL_TREE, $4, $1); } + { parse_decl_instantiation (NULL_TREE, $4, $1); } end_explicit_instantiation {} ; @@ -4072,7 +4074,7 @@ parse_xref_tag (tree aggr, tree name, int globalize) return xref_tag (tag_kind, name, attributes, globalize); } -/* Like handle_class_head, but AGGR may be as for parse_xref_tag. */ +/* Like handle_class_head, but AGGR may be as for parse_xref_tag. */ static tree parse_handle_class_head (tree aggr, tree scope, tree id, @@ -4085,4 +4087,14 @@ parse_handle_class_head (tree aggr, tree scope, tree id, defn_p, new_type_p); } +/* Like do_decl_instantiation, but the declarator has not yet been + parsed. */ + +static void +parse_decl_instantiation (tree declspecs, tree declarator, tree storage) +{ + tree decl = grokdeclarator (declarator, declspecs, NORMAL, 0, NULL); + do_decl_instantiation (decl, storage); +} + #include "gt-cp-parse.h" diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2e589e7a71f..92933feb951 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9503,13 +9503,11 @@ most_specialized_class (tmpl, args) return champ; } -/* called from the parser. */ +/* Explicitly instantiate DECL. */ void -do_decl_instantiation (declspecs, declarator, storage) - tree declspecs, declarator, storage; +do_decl_instantiation (tree decl, tree storage) { - tree decl = grokdeclarator (declarator, declspecs, NORMAL, 0, NULL); tree result = NULL_TREE; int extern_p = 0; |