summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/cgraphunit.c2
-rw-r--r--gcc/dbxout.c2
-rw-r--r--gcc/debug.c2
-rw-r--r--gcc/debug.h2
-rw-r--r--gcc/dwarf2out.c55
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto.c2
-rw-r--r--gcc/sdbout.c2
9 files changed, 49 insertions, 36 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e42b2e77f4e..5b35f9224fc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2016-09-20 Richard Biener <rguenther@suse.de>
+
+ * debug.h (gcc_debug_hooks): Add filename parameter to early_finish
+ hook.
+ * debug.c (do_nothing_debug_hooks): Adjust.
+ * dbxout.c (dbx_debug_hooks): Likewise.
+ * sdbout.c (sdb_debug_hooks): Likewise.
+ * dwarf2out.c (dwarf2_lineno_debug_hooks): Likewise.
+ (dwarf2out_finish): Move producer, filename and
+ path annotation ...
+ (dwarf2out_early_finish): ... here. Remove in_lto_p special-casing.
+ * cgraphunit.c (symbol_table::finalize_compilation_unit): Adjust.
+
2016-09-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/77434
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 6a1d1267202..eb611c1d74c 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -2561,7 +2561,7 @@ symbol_table::finalize_compilation_unit (void)
/* Clean up anything that needs cleaning up after initial debug
generation. */
- (*debug_hooks->early_finish) ();
+ (*debug_hooks->early_finish) (main_input_filename);
}
/* Finally drive the pass manager. */
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index ad256c706a0..5485a6cbc88 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -344,7 +344,7 @@ const struct gcc_debug_hooks dbx_debug_hooks =
{
dbxout_init,
dbxout_finish,
- debug_nothing_void,
+ debug_nothing_charstar,
debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
diff --git a/gcc/debug.c b/gcc/debug.c
index 9c2caaea695..3d658e883b8 100644
--- a/gcc/debug.c
+++ b/gcc/debug.c
@@ -26,7 +26,7 @@ const struct gcc_debug_hooks do_nothing_debug_hooks =
{
debug_nothing_charstar,
debug_nothing_charstar,
- debug_nothing_void, /* early_finish */
+ debug_nothing_charstar, /* early_finish */
debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
diff --git a/gcc/debug.h b/gcc/debug.h
index 6711f8bd620..34b63d7c590 100644
--- a/gcc/debug.h
+++ b/gcc/debug.h
@@ -31,7 +31,7 @@ struct gcc_debug_hooks
void (* finish) (const char *main_filename);
/* Run cleanups necessary after early debug generation. */
- void (* early_finish) (void);
+ void (* early_finish) (const char *main_filename);
/* Called from cgraph_optimize before starting to assemble
functions/variables/toplevel asms. */
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 10f8ba93a15..61c515207f6 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2480,7 +2480,7 @@ build_cfa_aligned_loc (dw_cfa_location *cfa,
static void dwarf2out_init (const char *);
static void dwarf2out_finish (const char *);
-static void dwarf2out_early_finish (void);
+static void dwarf2out_early_finish (const char *);
static void dwarf2out_assembly_start (void);
static void dwarf2out_define (unsigned int, const char *);
static void dwarf2out_undef (unsigned int, const char *);
@@ -2556,7 +2556,7 @@ const struct gcc_debug_hooks dwarf2_lineno_debug_hooks =
{
dwarf2out_init,
debug_nothing_charstar,
- debug_nothing_void,
+ debug_nothing_charstar,
debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
@@ -27804,7 +27804,7 @@ flush_limbo_die_list (void)
and generate the DWARF-2 debugging info. */
static void
-dwarf2out_finish (const char *filename)
+dwarf2out_finish (const char *)
{
comdat_type_node *ctnode;
dw_die_ref main_comp_unit_die;
@@ -27816,34 +27816,8 @@ dwarf2out_finish (const char *filename)
DIEs generated after early finish. */
gcc_assert (deferred_asm_name == NULL);
- /* PCH might result in DW_AT_producer string being restored from the
- header compilation, so always fill it with empty string initially
- and overwrite only here. */
- dw_attr_node *producer = get_AT (comp_unit_die (), DW_AT_producer);
- producer_string = gen_producer_string ();
- producer->dw_attr_val.v.val_str->refcount--;
- producer->dw_attr_val.v.val_str = find_AT_string (producer_string);
-
gen_remaining_tmpl_value_param_die_attribute ();
- /* Add the name for the main input file now. We delayed this from
- dwarf2out_init to avoid complications with PCH.
- For LTO produced units use a fixed artificial name to avoid
- leaking tempfile names into the dwarf. */
- if (!in_lto_p)
- add_name_attribute (comp_unit_die (), remap_debug_filename (filename));
- else
- add_name_attribute (comp_unit_die (), "<artificial>");
- if (!IS_ABSOLUTE_PATH (filename) || targetm.force_at_comp_dir)
- add_comp_dir_attribute (comp_unit_die ());
- else if (get_AT (comp_unit_die (), DW_AT_comp_dir) == NULL)
- {
- bool p = false;
- file_table->traverse<bool *, file_table_relative_p> (&p);
- if (p)
- add_comp_dir_attribute (comp_unit_die ());
- }
-
#if ENABLE_ASSERT_CHECKING
{
dw_die_ref die = comp_unit_die (), c;
@@ -28151,10 +28125,31 @@ dwarf2out_finish (const char *filename)
has run. */
static void
-dwarf2out_early_finish (void)
+dwarf2out_early_finish (const char *filename)
{
set_early_dwarf s;
+ /* PCH might result in DW_AT_producer string being restored from the
+ header compilation, so always fill it with empty string initially
+ and overwrite only here. */
+ dw_attr_node *producer = get_AT (comp_unit_die (), DW_AT_producer);
+ producer_string = gen_producer_string ();
+ producer->dw_attr_val.v.val_str->refcount--;
+ producer->dw_attr_val.v.val_str = find_AT_string (producer_string);
+
+ /* Add the name for the main input file now. We delayed this from
+ dwarf2out_init to avoid complications with PCH. */
+ add_name_attribute (comp_unit_die (), remap_debug_filename (filename));
+ if (!IS_ABSOLUTE_PATH (filename) || targetm.force_at_comp_dir)
+ add_comp_dir_attribute (comp_unit_die ());
+ else if (get_AT (comp_unit_die (), DW_AT_comp_dir) == NULL)
+ {
+ bool p = false;
+ file_table->traverse<bool *, file_table_relative_p> (&p);
+ if (p)
+ add_comp_dir_attribute (comp_unit_die ());
+ }
+
/* With LTO early dwarf was really finished at compile-time, so make
sure to adjust the phase after annotating the LTRANS CU DIE. */
if (in_lto_p)
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index c5bd7a07a6e..67fc164aad9 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2016-09-20 Richard Biener <rguenther@suse.de>
+
+ * lto.c (lto_main): Call early_finish with "<artificial>" as
+ filename.
+
2016-09-19 Richard Biener <rguenther@suse.de>
* lto.c (lto_main): Invoke early_finish debug hook.
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index c94ed622307..ecd30b99574 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -3316,7 +3316,7 @@ lto_main (void)
lto_promote_statics_nonwpa ();
/* Annotate the CU DIE and mark the early debug phase as finished. */
- debug_hooks->early_finish ();
+ debug_hooks->early_finish ("<artificial>");
/* Let the middle end know that we have read and merged all of
the input files. */
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index dc52716391e..7eea772bed7 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -277,7 +277,7 @@ const struct gcc_debug_hooks sdb_debug_hooks =
{
sdbout_init, /* init */
sdbout_finish, /* finish */
- debug_nothing_void, /* early_finish */
+ debug_nothing_charstar, /* early_finish */
debug_nothing_void, /* assembly_start */
debug_nothing_int_charstar, /* define */
debug_nothing_int_charstar, /* undef */