timevar.c: Fix formatting.

* timevar.c: Fix formatting.
	* tlink.c: Likewise.
	* toplev.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-inline.c: Likewise.

From-SVN: r53591
This commit is contained in:
Kazu Hirata 2002-05-18 15:16:25 +00:00 committed by Kazu Hirata
parent 770dc0c5b9
commit d92b44865f
6 changed files with 89 additions and 81 deletions

View File

@ -1,3 +1,11 @@
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

View File

@ -171,7 +171,7 @@ static struct timevar_time_def start_time;
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
@ -210,11 +210,11 @@ get_time (now)
/* 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;
@ -249,7 +249,7 @@ init_timevar ()
/* 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. */
@ -285,13 +285,13 @@ timevar_push (timevar)
/* 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. */
@ -396,7 +396,7 @@ timevar_get (timevar, elapsed)
struct timevar_time_def now;
*elapsed = tv->elapsed;
/* Is TIMEVAR currently running as a standalone timer? */
if (tv->standalone)
{
@ -472,21 +472,21 @@ timevar_print (fp)
#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 */
@ -498,15 +498,15 @@ timevar_print (fp)
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) */
}
@ -533,6 +533,6 @@ print_time (str, total)
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));
}

View File

@ -132,7 +132,7 @@ symbol_hash_lookup (string, create)
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));
}
@ -169,7 +169,7 @@ file_hash_lookup (string)
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));
}
@ -204,7 +204,7 @@ demangled_hash_lookup (string, create)
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));
}
@ -292,7 +292,7 @@ tlink_init ()
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);
@ -320,7 +320,7 @@ tlink_execute (prog, argv, redir)
{
collect_execute (prog, argv, redir);
return collect_wait (prog);
}
}
static char *
frob_extension (s, ext)
@ -425,7 +425,7 @@ read_repo_file (f)
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)
@ -497,7 +497,7 @@ recompile_files ()
putenv (xstrdup ("COMPILER_PATH"));
putenv (xstrdup ("LIBRARY_PATH"));
while ((f = file_pop ()) != NULL)
{
char *line, *command;
@ -587,7 +587,7 @@ demangle_new_symbols ()
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)
@ -613,7 +613,7 @@ scan_linker_output (fname)
char *p = line, *q;
symbol *sym;
int end;
while (*p && ISSPACE ((unsigned char)*p))
++p;
@ -679,8 +679,8 @@ scan_linker_output (fname)
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);
}
@ -700,7 +700,7 @@ scan_linker_output (fname)
sym->tweaking = 1;
file_push (sym->file);
}
obstack_free (&temporary_obstack, temporary_firstobj);
}

View File

@ -2512,7 +2512,7 @@ rest_of_compilation (decl)
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. */
@ -2528,7 +2528,7 @@ rest_of_compilation (decl)
/* 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))
@ -3868,7 +3868,7 @@ decode_f_option (arg)
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)));

View File

@ -65,7 +65,7 @@ queue (di, t, flags)
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. */
@ -156,7 +156,7 @@ dump_maybe_newline (di)
dump_info_p di;
{
int extra;
/* See if we need a new line. */
if (di->column > EOL_COLUMN)
dump_new_line (di);
@ -247,7 +247,7 @@ dump_next_stmt (di, t)
/* Dump the next node in the queue. */
static void
static void
dequeue_and_dump (di)
dump_info_p di;
{
@ -300,7 +300,7 @@ dequeue_and_dump (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));
@ -319,17 +319,17 @@ dequeue_and_dump (di)
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 ();
}
@ -339,7 +339,7 @@ dequeue_and_dump (di)
/* 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. */
@ -356,7 +356,7 @@ dequeue_and_dump (di)
++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;
}
@ -370,7 +370,7 @@ dequeue_and_dump (di)
{
/* All types have qualifiers. */
int quals = (*lang_hooks.tree_dump.type_quals) (t);
if (quals != TYPE_UNQUALIFIED)
{
fprintf (di->stream, "qual: %c%c%c ",
@ -386,7 +386,7 @@ dequeue_and_dump (di)
/* 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));
@ -473,10 +473,10 @@ dequeue_and_dump (di)
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;
@ -502,7 +502,7 @@ dequeue_and_dump (di)
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));
@ -566,7 +566,7 @@ dequeue_and_dump (di)
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));
@ -720,7 +720,7 @@ dequeue_and_dump (di)
becomes NULL. */
dump_child ("init", TREE_OPERAND (t, 3));
break;
case EXPR_WITH_FILE_LOCATION:
dump_child ("expr", EXPR_WFL_NODE (t));
break;
@ -733,7 +733,7 @@ dequeue_and_dump (di)
done:
if (dump_flag (di, TDF_ADDRESS, NULL))
dump_pointer (di, "addr", (void *)t);
/* Terminate the line. */
fprintf (di->stream, "\n");
}
@ -770,7 +770,7 @@ dump_node (t, flags, stream)
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. */
@ -838,10 +838,10 @@ dump_begin (phase, flag_ptr)
{
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)
@ -851,7 +851,7 @@ dump_begin (phase, flag_ptr)
free (name);
if (flag_ptr)
*flag_ptr = dump_files[phase].flags;
return stream;
}
@ -893,26 +893,26 @@ dump_switch_p (arg)
{
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
@ -926,10 +926,10 @@ dump_switch_p (arg)
found:;
ptr = end_ptr;
}
dump_files[ix].state = -1;
dump_files[ix].flags = flags;
return 1;
}
return 0;

View File

@ -38,11 +38,11 @@ Boston, MA 02111-1307, USA. */
/* 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;
@ -166,7 +166,7 @@ remap_decl (decl, id)
DECL_ANON_UNION_ELEMS. */
tree members = NULL;
tree src;
for (src = DECL_ANON_UNION_ELEMS (t); src;
src = TREE_CHAIN (src))
{
@ -178,7 +178,7 @@ remap_decl (decl, id)
}
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,
@ -563,7 +563,7 @@ initialize_inlined_parameters (id, args, fn)
/* 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. */
@ -677,7 +677,7 @@ inlinable_function_p (fn, id)
/* Assume it is not inlinable. */
inlinable = 0;
/* The number of instructions (estimated) of current function. */
currfn_insns = DECL_NUM_STMTS (fn) * INSNS_PER_STMT;
@ -693,7 +693,7 @@ inlinable_function_p (fn, id)
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)
@ -712,7 +712,7 @@ inlinable_function_p (fn, id)
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
@ -726,7 +726,7 @@ inlinable_function_p (fn, id)
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)
@ -736,7 +736,7 @@ inlinable_function_p (fn, id)
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))
@ -1034,7 +1034,7 @@ optimize_inline_calls (fn)
{
inline_data id;
tree prev_fn;
/* Clear out ID. */
memset (&id, 0, sizeof (id));
@ -1051,7 +1051,7 @@ optimize_inline_calls (fn)
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");
@ -1075,7 +1075,7 @@ optimize_inline_calls (fn)
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;
@ -1122,7 +1122,7 @@ clone_body (clone, fn, arg_map)
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;
@ -1133,7 +1133,7 @@ walk_tree (tp, func, data, htab_)
enum tree_code code;
int walk_subtrees;
tree result;
#define WALK_SUBTREE(NODE) \
do \
{ \
@ -1159,7 +1159,7 @@ walk_tree (tp, func, data, htab_)
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))
@ -1219,8 +1219,8 @@ walk_tree (tp, func, data, htab_)
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
@ -1342,10 +1342,10 @@ walk_tree (tp, func, data, htab_)
#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;
@ -1422,7 +1422,7 @@ remap_save_expr (tp, st_, fn, walk_subtrees)
/* 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)
{