Commit 297a5329 by Jason Merrill Committed by Jason Merrill

tree.c (count_trees): New debugging function.

        * tree.c (count_trees): New debugging function.

        * typeck.c (build_x_function_call): Use DECL_FUNCTION_TEMPLATE_P.
        * init.c (build_member_call): Pull out the name of a DECL.

        * Makefile.in (semantics.o, pt.o): Depend on TIMEVAR_H.
        * semantics.c (expand_body): Push to TV_INTEGRATION here.
        * optimize.c (optimize_function): Not here.
        * pt.c (instantiate_decl): Push to TV_PARSE.

From-SVN: r34568
parent f5e6b7bc
2000-06-15 Jason Merrill <jason@redhat.com>
* tree.c (count_trees): New debugging function.
* typeck.c (build_x_function_call): Use DECL_FUNCTION_TEMPLATE_P.
* init.c (build_member_call): Pull out the name of a DECL.
* Makefile.in (semantics.o, pt.o): Depend on TIMEVAR_H.
* semantics.c (expand_body): Push to TV_INTEGRATION here.
* optimize.c (optimize_function): Not here.
* pt.c (instantiate_decl): Push to TV_PARSE.
2000-06-15 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (DECL_PENDING_INLINE_P): Relax checking.
......
......@@ -211,6 +211,7 @@ PARSE_C = $(srcdir)/parse.c
EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
GGC_H = $(srcdir)/../ggc.h $(srcdir)/../varray.h
HTAB_H = $(srcdir)/../../include/hashtab.h
TIMEVAR_H = $(srcdir)/../timevar.h $(srcdir)/../timevar.def
parse.o : $(PARSE_C) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
$(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \
......@@ -306,7 +307,7 @@ repo.o : repo.c $(CXX_TREE_H) \
semantics.o: semantics.c $(CXX_TREE_H) lex.h \
$(srcdir)/../except.h $(srcdir)/../toplev.h \
$(srcdir)/../flags.h $(GGC_H) \
$(srcdir)/../output.h $(RTL_H)
$(srcdir)/../output.h $(RTL_H) $(TIMEVAR_H)
dump.o: dump.c $(CXX_TREE_H)
optimize.o: optimize.c $(CXX_TREE_H) \
$(srcdir)/../rtl.h $(srcdir)/../integrate.h ../insn-config.h \
......
......@@ -1470,6 +1470,9 @@ build_member_call (type, name, parmlist)
return build_x_function_call (name, parmlist, current_class_ref);
}
if (DECL_P (name))
name = DECL_NAME (name);
if (type == std_node)
return build_x_function_call (do_scoped_id (name, 0), parmlist,
current_class_ref);
......
......@@ -28,7 +28,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "input.h"
#include "integrate.h"
#include "varray.h"
#include "timevar.h"
/* To Do:
......@@ -810,8 +809,6 @@ optimize_function (fn)
tree prev_fn;
struct saved_scope *s;
timevar_push (TV_INTEGRATION);
/* Clear out ID. */
memset (&id, 0, sizeof (id));
......@@ -842,8 +839,6 @@ optimize_function (fn)
/* Clean up. */
VARRAY_FREE (id.fns);
VARRAY_FREE (id.target_exprs);
timevar_pop (TV_INTEGRATION);
}
}
......
......@@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA. */
#include "defaults.h"
#include "ggc.h"
#include "hashtab.h"
#include "timevar.h"
/* The type of functions taking a tree, and some additional data, and
returning an int. */
......@@ -9530,6 +9531,8 @@ instantiate_decl (d, defer_ok)
if (! push_tinst_level (d))
return d;
timevar_push (TV_PARSE);
/* Set TD to the template whose DECL_TEMPLATE_RESULT is the pattern
for the instantiation. This is not always the most general
template. Consider, for example:
......@@ -9721,6 +9724,8 @@ out:
pop_from_top_level ();
pop_tinst_level ();
timevar_pop (TV_PARSE);
return d;
}
......
......@@ -2789,11 +2789,14 @@ expand_body (fn)
return;
}
timevar_push (TV_EXPAND);
timevar_push (TV_INTEGRATION);
/* Optimize the body of the function before expanding it. */
optimize_function (fn);
timevar_pop (TV_INTEGRATION);
timevar_push (TV_EXPAND);
/* Save the current file name and line number. When we expand the
body of the function, we'll set LINENO and INPUT_FILENAME so that
error-mesages come out in the right places. */
......
......@@ -1396,6 +1396,30 @@ walk_tree (tp, func, data)
#undef WALK_SUBTREE
}
int n_trees;
static tree
count_trees_r (tp, walk_subtrees, data)
tree *tp ATTRIBUTE_UNUSED;
int *walk_subtrees ATTRIBUTE_UNUSED;
void *data ATTRIBUTE_UNUSED;
{
++n_trees;
return NULL_TREE;
}
/* Debugging function for measuring the rough complexity of a tree
representation. */
int
count_trees (t)
tree t;
{
n_trees = 0;
walk_tree (&t, count_trees_r, NULL);
return n_trees;
}
/* Passed to walk_tree. Checks for the use of types with no linkage. */
static tree
......
......@@ -2578,7 +2578,7 @@ build_x_function_call (function, params, decl)
if ((TREE_CODE (function) == FUNCTION_DECL
&& DECL_STATIC_FUNCTION_P (function))
|| (TREE_CODE (function) == TEMPLATE_DECL
|| (DECL_FUNCTION_TEMPLATE_P (function)
&& DECL_STATIC_FUNCTION_P (DECL_TEMPLATE_RESULT (function))))
return build_member_call (DECL_CONTEXT (function),
template_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment