Commit d92b4486 by Kazu Hirata Committed by Kazu Hirata

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