const char *main_input_filename;
+#ifndef USE_MAPPED_LOCATION
+location_t unknown_location = { NULL, 0 };
+#endif
+
/* Used to enable -fvar-tracking, -fweb and -frename-registers according
to optimize and default_debug_hooks in process_options (). */
#define AUTODETECT_FLAG_VAR_TRACKING 2
return;
if (DECL_P (node))
- warning ("`%s' is deprecated (declared at %s:%d)",
- IDENTIFIER_POINTER (DECL_NAME (node)),
- DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
+ {
+ expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (node));
+ warning ("`%s' is deprecated (declared at %s:%d)",
+ IDENTIFIER_POINTER (DECL_NAME (node)),
+ xloc.file, xloc.line);
+ }
else if (TYPE_P (node))
{
const char *what = NULL;
&& DECL_NAME (TYPE_NAME (node)))
what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)));
- if (what)
+ if (decl)
{
- if (decl)
+ expanded_location xloc
+ = expand_location (DECL_SOURCE_LOCATION (decl));
+ if (what)
warning ("`%s' is deprecated (declared at %s:%d)", what,
- DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
+ xloc.file, xloc.line);
else
- warning ("`%s' is deprecated", what);
+ warning ("type is deprecated (declared at %s:%d)",
+ xloc.file, xloc.line);
}
- else if (decl)
- warning ("type is deprecated (declared at %s:%d)",
- DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
else
- warning ("type is deprecated");
+ {
+ if (what)
+ warning ("type is deprecated");
+ else
+ warning ("`%s' is deprecated", what);
+ }
}
}
INPUT_LOCATION accordingly. */
void
+#ifdef USE_MAPPED_LOCATION
+push_srcloc (location_t fline)
+#else
push_srcloc (const char *file, int line)
+#endif
{
struct file_stack *fs;
fs = xmalloc (sizeof (struct file_stack));
fs->location = input_location;
fs->next = input_file_stack;
+#ifdef USE_MAPPED_LOCATION
+ input_location = fline;
+#else
input_filename = file;
input_line = line;
+#endif
input_file_stack = fs;
input_file_stack_tick++;
}
sets the original filename if appropriate (e.g. foo.i -> foo.c)
so we can correctly initialize debug output. */
no_backend = lang_hooks.post_options (&main_input_filename);
+#ifndef USE_MAPPED_LOCATION
input_filename = main_input_filename;
+#endif
#ifdef OVERRIDE_OPTIONS
/* Some machines may reject certain combinations of options. */
if (flag_unroll_loops || flag_peel_loops)
flag_rerun_cse_after_loop = 1;
+ /* If explicitly asked to run new loop optimizer, switch off the old
+ one. */
+ if (flag_loop_optimize2)
+ flag_loop_optimize = 0;
+
+ /* Enable new loop optimizer pass if any of its optimizations is called. */
+ if (flag_move_loop_invariants
+ || flag_unswitch_loops
+ || flag_peel_loops
+ || flag_unroll_loops
+ || flag_branch_on_count_reg)
+ flag_loop_optimize2 = 1;
+
if (flag_non_call_exceptions)
flag_asynchronous_unwind_tables = 1;
if (flag_asynchronous_unwind_tables)
/* Enable line number info for traceback. */
|| debug_info_level > DINFO_LEVEL_NONE
#endif
- || flag_test_coverage
- || warn_notreached);
+ || flag_test_coverage);
init_regs ();
init_fake_stack_mems ();
static int
lang_dependent_init (const char *name)
{
+ location_t save_loc = input_location;
if (dump_base_name == 0)
dump_base_name = name ? name : "gccdump";
/* Other front-end initialization. */
+#ifdef USE_MAPPED_LOCATION
+ input_location = BUILTINS_LOCATION;
+#else
+ input_filename = "<built-in>";
+ input_line = 0;
+#endif
if (lang_hooks.init () == 0)
return 0;
+ input_location = save_loc;
init_asm_output (name);