* 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
+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.
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 \
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 \
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);
#include "input.h"
#include "integrate.h"
#include "varray.h"
-#include "timevar.h"
/* To Do:
tree prev_fn;
struct saved_scope *s;
- timevar_push (TV_INTEGRATION);
-
/* Clear out ID. */
memset (&id, 0, sizeof (id));
/* Clean up. */
VARRAY_FREE (id.fns);
VARRAY_FREE (id.target_exprs);
-
- timevar_pop (TV_INTEGRATION);
}
}
#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. */
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:
pop_from_top_level ();
pop_tinst_level ();
+ timevar_pop (TV_PARSE);
+
return d;
}
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. */
#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
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