* timevar.c: Fix formatting.
* tlink.c: Likewise.
* toplev.c: Likewise.
* tree-dump.c: Likewise.
* tree-inline.c: Likewise.
From-SVN: r53591
+2002-05-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * timevar.c: Fix formatting.
+ * tlink.c: Likewise.
+ * toplev.c: Likewise.
+ * tree-dump.c: Likewise.
+ * tree-inline.c: Likewise.
+
2002-05-18 Neil Booth <neil@daikokuya.demon.co.uk>
* cppinit.c (cpp_post_options): If preprocessed, turn off
static void get_time
PARAMS ((struct timevar_time_def *));
static void timevar_accumulate
- PARAMS ((struct timevar_time_def *, struct timevar_time_def *,
+ PARAMS ((struct timevar_time_def *, struct timevar_time_def *,
struct timevar_time_def *));
/* Fill the current times into TIME. The definition of this function
/* Add the difference between STOP_TIME and START_TIME to TIMER. */
-static void
+static void
timevar_accumulate (timer, start_time, stop_time)
- struct timevar_time_def *timer;
- struct timevar_time_def *start_time;
- struct timevar_time_def *stop_time;
+ struct timevar_time_def *timer;
+ struct timevar_time_def *start_time;
+ struct timevar_time_def *stop_time;
{
timer->user += stop_time->user - start_time->user;
timer->sys += stop_time->sys - start_time->sys;
/* Push TIMEVAR onto the timing stack. No further elapsed time is
attributed to the previous topmost timing variable on the stack;
subsequent elapsed time is attributed to TIMEVAR, until it is
- popped or another element is pushed on top.
+ popped or another element is pushed on top.
TIMEVAR cannot be running as a standalone timer. */
/* See if we have a previously-allocated stack instance. If so,
take it off the list. If not, malloc a new one. */
- if (unused_stack_instances != NULL)
+ if (unused_stack_instances != NULL)
{
context = unused_stack_instances;
unused_stack_instances = unused_stack_instances->next;
}
else
- context = (struct timevar_stack_def *)
+ context = (struct timevar_stack_def *)
xmalloc (sizeof (struct timevar_stack_def));
/* Fill it in and put it on the stack. */
struct timevar_time_def now;
*elapsed = tv->elapsed;
-
+
/* Is TIMEVAR currently running as a standalone timer? */
if (tv->standalone)
{
#ifdef HAVE_USER_TIME
/* Print user-mode time for this process. */
- fprintf (fp, "%7.2f (%2.0f%%) usr",
+ fprintf (fp, "%7.2f (%2.0f%%) usr",
tv->elapsed.user,
(total->user == 0 ? 0 : tv->elapsed.user / total->user) * 100);
#endif /* HAVE_USER_TIME */
#ifdef HAVE_SYS_TIME
/* Print system-mode time for this process. */
- fprintf (fp, "%7.2f (%2.0f%%) sys",
+ fprintf (fp, "%7.2f (%2.0f%%) sys",
tv->elapsed.sys,
(total->sys == 0 ? 0 : tv->elapsed.sys / total->sys) * 100);
#endif /* HAVE_SYS_TIME */
#ifdef HAVE_WALL_TIME
/* Print wall clock time elapsed. */
- fprintf (fp, "%7.2f (%2.0f%%) wall",
+ fprintf (fp, "%7.2f (%2.0f%%) wall",
tv->elapsed.wall,
(total->wall == 0 ? 0 : tv->elapsed.wall / total->wall) * 100);
#endif /* HAVE_WALL_TIME */
fputs (_(" TOTAL :"), fp);
#ifdef HAVE_USER_TIME
fprintf (fp, "%7.2f ", total->user);
-#endif
+#endif
#ifdef HAVE_SYS_TIME
fprintf (fp, "%7.2f ", total->sys);
#endif
#ifdef HAVE_WALL_TIME
fprintf (fp, "%7.2f\n", total->wall);
#endif
-
-#endif /* defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME)
+
+#endif /* defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME)
|| defined (HAVE_WALL_TIME) */
}
fprintf (stderr,
_("time in %s: %ld.%06ld (%ld%%)\n"),
str, total / 1000000, total % 1000000,
- all_time == 0 ? 0
- : (long) (((100.0 * (double) total) / (double) all_time) + .5));
+ all_time == 0 ? 0
+ : (long) (((100.0 * (double) total) / (double) all_time) + .5));
}
int create;
{
return ((struct symbol_hash_entry *)
- hash_lookup (&symbol_table, (const hash_table_key) string,
+ hash_lookup (&symbol_table, (const hash_table_key) string,
create, string_copy));
}
const char *string;
{
return ((struct file_hash_entry *)
- hash_lookup (&file_table, (const hash_table_key) string, true,
+ hash_lookup (&file_table, (const hash_table_key) string, true,
string_copy));
}
int create;
{
return ((struct demangled_hash_entry *)
- hash_lookup (&demangled_table, (const hash_table_key) string,
+ hash_lookup (&demangled_table, (const hash_table_key) string,
create, string_copy));
}
\f
hash_table_init (&symbol_table, symbol_hash_newfunc, string_hash,
string_compare);
- hash_table_init (&file_table, file_hash_newfunc, string_hash,
+ hash_table_init (&file_table, file_hash_newfunc, string_hash,
string_compare);
hash_table_init (&demangled_table, demangled_hash_newfunc,
string_hash, string_compare);
{
collect_execute (prog, argv, redir);
return collect_wait (prog);
-}
+}
static char *
frob_extension (s, ext)
FILE *stream = fopen ((char*) f->root.key, "r");
if (tlink_verbose >= 2)
- fprintf (stderr, _("collect: reading %s\n"),
+ fprintf (stderr, _("collect: reading %s\n"),
(char*) f->root.key);
while (fscanf (stream, "%c ", &c) == 1)
putenv (xstrdup ("COMPILER_PATH"));
putenv (xstrdup ("LIBRARY_PATH"));
-
+
while ((f = file_pop ()) != NULL)
{
char *line, *command;
while ((sym = symbol_pop ()) != NULL)
{
demangled *dem;
- const char *p = cplus_demangle ((char*) sym->root.key,
+ const char *p = cplus_demangle ((char*) sym->root.key,
DMGL_PARAMS | DMGL_ANSI);
if (! p)
char *p = line, *q;
symbol *sym;
int end;
-
+
while (*p && ISSPACE ((unsigned char)*p))
++p;
if (dem)
sym = symbol_hash_lookup (dem->mangled, false);
else
- {
- if (*p == '_' && prepends_underscore)
+ {
+ if (*p == '_' && prepends_underscore)
++p;
sym = symbol_hash_lookup (p, false);
}
sym->tweaking = 1;
file_push (sym->file);
}
-
+
obstack_free (&temporary_obstack, temporary_firstobj);
}
rebuild_jump_labels (insns);
find_exception_handler_labels ();
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
-
+
delete_unreachable_blocks ();
/* Turn NOTE_INSN_PREDICTIONs into branch predictions. */
/* There is pass ordering problem - we must lower NOTE_INSN_PREDICTION
notes before simplifying cfg and we must do lowering after sibcall
that unhides parts of RTL chain and cleans up the CFG.
-
+
Until sibcall is replaced by tree-level optimizer, lets just
sweep away the NOTE_INSN_PREDICTION notes that leaked out. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, nm);
}
else if ((option_value
- = skip_leading_substring (arg, "message-length=")))
+ = skip_leading_substring (arg, "message-length=")))
output_set_maximum_length
(&global_dc->buffer, read_integral_parameter
(option_value, arg - 2, diagnostic_line_cutoff (global_dc)));
dni = (dump_node_info_p) xmalloc (sizeof (struct dump_node_info));
dni->index = index;
dni->binfo_p = ((flags & DUMP_BINFO) != 0);
- dq->node = splay_tree_insert (di->nodes, (splay_tree_key) t,
+ dq->node = splay_tree_insert (di->nodes, (splay_tree_key) t,
(splay_tree_value) dni);
/* Add it to the end of the queue. */
dump_info_p di;
{
int extra;
-
+
/* See if we need a new line. */
if (di->column > EOL_COLUMN)
dump_new_line (di);
/* Dump the next node in the queue. */
-static void
+static void
dequeue_and_dump (di)
dump_info_p di;
{
dump_string (di, "priv");
if (TREE_VIA_VIRTUAL (t))
dump_string (di, "virt");
-
+
dump_child ("type", BINFO_TYPE (t));
dump_child ("base", BINFO_BASETYPES (t));
case '1':
dump_child ("op 0", TREE_OPERAND (t, 0));
break;
-
+
case '2':
case '<':
dump_child ("op 0", TREE_OPERAND (t, 0));
dump_child ("op 1", TREE_OPERAND (t, 1));
break;
-
+
case 'e':
/* These nodes are handled explicitly below. */
break;
-
+
default:
abort ();
}
/* All declarations have names. */
if (DECL_NAME (t))
dump_child ("name", DECL_NAME (t));
- if (DECL_ASSEMBLER_NAME_SET_P (t)
+ if (DECL_ASSEMBLER_NAME_SET_P (t)
&& DECL_ASSEMBLER_NAME (t) != DECL_NAME (t))
dump_child ("mngl", DECL_ASSEMBLER_NAME (t));
/* And types. */
++filename;
dump_maybe_newline (di);
- fprintf (di->stream, "srcp: %s:%-6d ", filename,
+ fprintf (di->stream, "srcp: %s:%-6d ", filename,
DECL_SOURCE_LINE (t));
di->column += 6 + strlen (filename) + 8;
}
{
/* All types have qualifiers. */
int quals = (*lang_hooks.tree_dump.type_quals) (t);
-
+
if (quals != TYPE_UNQUALIFIED)
{
fprintf (di->stream, "qual: %c%c%c ",
/* All types have a main variant. */
if (TYPE_MAIN_VARIANT (t) != t)
dump_child ("unql", TYPE_MAIN_VARIANT (t));
-
+
/* And sizes. */
dump_child ("size", TYPE_SIZE (t));
dump_string (di, "struct");
else
dump_string (di, "union");
-
+
dump_child ("flds", TYPE_FIELDS (t));
dump_child ("fncs", TYPE_METHODS (t));
- queue_and_dump_index (di, "binf", TYPE_BINFO (t),
+ queue_and_dump_index (di, "binf", TYPE_BINFO (t),
DUMP_BINFO);
break;
if (DECL_FIELD_OFFSET (t))
dump_child ("bpos", bit_position (t));
}
- else if (TREE_CODE (t) == VAR_DECL
+ else if (TREE_CODE (t) == VAR_DECL
|| TREE_CODE (t) == PARM_DECL)
{
dump_int (di, "used", TREE_USED (t));
dump_child ("decl", DECL_STMT_DECL (t));
dump_next_stmt (di, t);
break;
-
+
case DO_STMT:
dump_stmt (di, t);
dump_child ("body", DO_BODY (t));
becomes NULL. */
dump_child ("init", TREE_OPERAND (t, 3));
break;
-
+
case EXPR_WITH_FILE_LOCATION:
dump_child ("expr", EXPR_WFL_NODE (t));
break;
done:
if (dump_flag (di, TDF_ADDRESS, NULL))
dump_pointer (di, "addr", (void *)t);
-
+
/* Terminate the line. */
fprintf (di->stream, "\n");
}
di.free_list = 0;
di.flags = flags;
di.node = t;
- di.nodes = splay_tree_new (splay_tree_compare_pointers, 0,
+ di.nodes = splay_tree_new (splay_tree_compare_pointers, 0,
(splay_tree_delete_value_fn) &free);
/* Queue up the first node. */
{
FILE *stream;
char *name;
-
+
if (!dump_files[phase].state)
return NULL;
-
+
name = concat (dump_base_name, dump_files[phase].suffix, NULL);
stream = fopen (name, dump_files[phase].state < 0 ? "w" : "a");
if (!stream)
free (name);
if (flag_ptr)
*flag_ptr = dump_files[phase].flags;
-
+
return stream;
}
{
unsigned ix;
const char *option_value;
-
+
for (ix = 0; ix != TDI_end; ix++)
if ((option_value = skip_leading_substring (arg, dump_files[ix].swtch)))
{
const char *ptr = option_value;
int flags = 0;
-
+
while (*ptr)
{
const struct dump_option_value_info *option_ptr;
const char *end_ptr;
unsigned length;
-
+
while (*ptr == '-')
ptr++;
end_ptr = strchr (ptr, '-');
if (!end_ptr)
end_ptr = ptr + strlen (ptr);
length = end_ptr - ptr;
-
+
for (option_ptr = dump_options; option_ptr->name;
option_ptr++)
if (strlen (option_ptr->name) == length
found:;
ptr = end_ptr;
}
-
+
dump_files[ix].state = -1;
dump_files[ix].flags = flags;
-
+
return 1;
}
return 0;
/* This should be eventually be generalized to other languages, but
this would require a shared function-as-trees infrastructure. */
-#include "c-common.h"
+#include "c-common.h"
/* 0 if we should not perform inlining.
- 1 if we should expand functions calls inline at the tree level.
- 2 if we should consider *all* functions to be inline
+ 1 if we should expand functions calls inline at the tree level.
+ 2 if we should consider *all* functions to be inline
candidates. */
int flag_inline_trees = 0;
DECL_ANON_UNION_ELEMS. */
tree members = NULL;
tree src;
-
+
for (src = DECL_ANON_UNION_ELEMS (t); src;
src = TREE_CHAIN (src))
{
}
DECL_ANON_UNION_ELEMS (t) = nreverse (members);
}
-
+
/* Remember it, so that if we encounter this local entity
again we can reuse this copy. */
n = splay_tree_insert (id->decl_map,
/* See if we need to clean up the declaration. */
cleanup = (*lang_hooks.maybe_build_cleanup) (var);
- if (cleanup)
+ if (cleanup)
{
tree cleanup_stmt;
/* Build the cleanup statement. */
/* Assume it is not inlinable. */
inlinable = 0;
-
+
/* The number of instructions (estimated) of current function. */
currfn_insns = DECL_NUM_STMTS (fn) * INSNS_PER_STMT;
else if (! DECL_INLINE (fn))
;
/* We can't inline functions that are too big. Only allow a single
- function to be of MAX_INLINE_INSNS_SINGLE size. Make special
+ function to be of MAX_INLINE_INSNS_SINGLE size. Make special
allowance for extern inline functions, though. */
else if (! (*lang_hooks.tree_inlining.disregard_inline_limits) (fn)
&& currfn_insns > MAX_INLINE_INSNS_SINGLE)
can inline this function, investigate further. */
if (! (*lang_hooks.tree_inlining.disregard_inline_limits) (fn)
&& inlinable)
- {
+ {
int sum_insns = (id ? id->inlined_stmts : 0) * INSNS_PER_STMT
+ currfn_insns;
/* In the extreme case that we have exceeded the recursive inlining
though. */
else if ((sum_insns > MAX_INLINE_INSNS)
&& (currfn_insns > MIN_INLINE_INSNS))
- {
+ {
int max_curr = MAX_INLINE_INSNS_SINGLE
- (sum_insns - MAX_INLINE_INSNS) / MAX_INLINE_SLOPE;
if (currfn_insns > max_curr)
if (inlinable && (*lang_hooks.tree_inlining.cannot_inline_tree_fn) (&fn))
inlinable = 0;
-
+
/* If we don't have the function body available, we can't inline
it. */
if (! DECL_SAVED_TREE (fn))
{
inline_data id;
tree prev_fn;
-
+
/* Clear out ID. */
memset (&id, 0, sizeof (id));
prev_fn = ((*lang_hooks.tree_inlining.add_pending_fn_decls)
(&id.fns, prev_fn));
-
+
/* Create the stack of TARGET_EXPRs. */
VARRAY_TREE_INIT (id.target_exprs, 32, "target_exprs");
if (DECL_LANG_SPECIFIC (fn))
{
tree ifn = make_tree_vec (VARRAY_ACTIVE_SIZE (id.inlined_fns));
-
+
memcpy (&TREE_VEC_ELT (ifn, 0), &VARRAY_TREE (id.inlined_fns, 0),
VARRAY_ACTIVE_SIZE (id.inlined_fns) * sizeof (tree));
DECL_INLINED_FNS (fn) = ifn;
to record the nodes visited, and to avoid visiting a node more than
once. */
-tree
+tree
walk_tree (tp, func, data, htab_)
tree *tp;
walk_tree_fn func;
enum tree_code code;
int walk_subtrees;
tree result;
-
+
#define WALK_SUBTREE(NODE) \
do \
{ \
if (htab)
{
void **slot;
-
+
/* Don't walk the same tree twice, if the user has requested
that we avoid doing so. */
if (htab_find (htab, *tp))
entire statement tree. */
if (statement_code_p (code))
{
- if (code == DECL_STMT
- && DECL_STMT_DECL (*tp)
+ if (code == DECL_STMT
+ && DECL_STMT_DECL (*tp)
&& DECL_P (DECL_STMT_DECL (*tp)))
{
/* Walk the DECL_INITIAL and DECL_SIZE. We don't want to walk
#undef WALK_SUBTREE
}
-/* Like walk_tree, but does not walk duplicate nodes more than
+/* Like walk_tree, but does not walk duplicate nodes more than
once. */
-tree
+tree
walk_tree_without_duplicates (tp, func, data)
tree *tp;
walk_tree_fn func;
/* See if we already encountered this SAVE_EXPR. */
n = splay_tree_lookup (st, (splay_tree_key) *tp);
-
+
/* If we didn't already remap this SAVE_EXPR, do so now. */
if (!n)
{