aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-05-14 19:06:19 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-05-14 19:06:19 +0200
commitd5c90983388dd8841b2cb1986fa0624a000731bd (patch)
tree6f616a680652148a97d51b2779585b212e19dac5
parent6052c299313c0cb62c2ff2666c94d92d3a039b83 (diff)
downloadgcc-d5c90983388dd8841b2cb1986fa0624a000731bd.zip
gcc-d5c90983388dd8841b2cb1986fa0624a000731bd.tar.gz
gcc-d5c90983388dd8841b2cb1986fa0624a000731bd.tar.bz2
dwarf2out.c (have_macinfo): Define.
* dwarf2out.c (have_macinfo): Define. (dwarf2out_finish): Don't emit DW_AT_GNU_macros or DW_AT_macro_info attribute, don't force empty compilation unit and don't emit any .debug_macinfo/.debug_macro section if macinfo_table is empty. From-SVN: r187473
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/dwarf2out.c17
2 files changed, 18 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 840dd22..5efbfe5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-14 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (have_macinfo): Define.
+ (dwarf2out_finish): Don't emit DW_AT_GNU_macros or DW_AT_macro_info
+ attribute, don't force empty compilation unit and don't emit any
+ .debug_macinfo/.debug_macro section if macinfo_table is empty.
+
2012-05-14 Georg-Johann Lay <avr@gjlay.de>
PR target/53344
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 9ba65fb..a92881b 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2799,6 +2799,12 @@ static GTY (()) VEC (pubname_entry, gc) * pubtype_table;
defines/undefines (and file start/end markers). */
static GTY (()) VEC (macinfo_entry, gc) * macinfo_table;
+/* True if .debug_macinfo or .debug_macros section is going to be
+ emitted. */
+#define have_macinfo \
+ (debug_info_level >= DINFO_LEVEL_VERBOSE \
+ && !VEC_empty (macinfo_entry, macinfo_table))
+
/* Array of dies for which we should generate .debug_ranges info. */
static GTY ((length ("ranges_table_allocated"))) dw_ranges_ref ranges_table;
@@ -22140,7 +22146,7 @@ dwarf2out_finish (const char *filename)
add_AT_lineptr (comp_unit_die (), DW_AT_stmt_list,
debug_line_section_label);
- if (debug_info_level >= DINFO_LEVEL_VERBOSE)
+ if (have_macinfo)
add_AT_macptr (comp_unit_die (),
dwarf_strict ? DW_AT_macro_info : DW_AT_GNU_macros,
macinfo_section_label);
@@ -22175,8 +22181,8 @@ dwarf2out_finish (const char *filename)
htab_delete (comdat_type_table);
/* Output the main compilation unit if non-empty or if .debug_macinfo
- will be emitted. */
- output_comp_unit (comp_unit_die (), debug_info_level >= DINFO_LEVEL_VERBOSE);
+ or .debug_macro will be emitted. */
+ output_comp_unit (comp_unit_die (), have_macinfo);
/* Output the abbreviation table. */
if (abbrev_die_table_in_use != 1)
@@ -22256,12 +22262,11 @@ dwarf2out_finish (const char *filename)
}
/* Have to end the macro section. */
- if (debug_info_level >= DINFO_LEVEL_VERBOSE)
+ if (have_macinfo)
{
switch_to_section (debug_macinfo_section);
ASM_OUTPUT_LABEL (asm_out_file, macinfo_section_label);
- if (!VEC_empty (macinfo_entry, macinfo_table))
- output_macinfo ();
+ output_macinfo ();
dw2_asm_output_data (1, 0, "End compilation unit");
}