Make-lang.in (cp/parse.o): Depend on decl.h.

* 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.

From-SVN: r55309
This commit is contained in:
Mark Mitchell 2002-07-08 02:25:19 +00:00 committed by Mark Mitchell
parent 5351f1ca74
commit eb8845bedb
5 changed files with 33 additions and 13 deletions

View File

@ -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

View File

@ -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)
#

View File

@ -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));

View File

@ -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"

View File

@ -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;