Commit 210cfe63 by Jakub Jelinek Committed by Jakub Jelinek

dwarf2out.c (dwarf2out_define, [...]): Treat lineno 1 the same as lineno 0…

dwarf2out.c (dwarf2out_define, [...]): Treat lineno 1 the same as lineno 0 before first start file directive.

	* dwarf2out.c (dwarf2out_define, dwarf2out_undef): Treat
	lineno 1 the same as lineno 0 before first start file directive.
	(optimize_macinfo_range): Likewise.

From-SVN: r187475
parent d5c90983
2012-05-14 Jakub Jelinek <jakub@redhat.com> 2012-05-14 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (dwarf2out_define, dwarf2out_undef): Treat
lineno 1 the same as lineno 0 before first start file directive.
(optimize_macinfo_range): Likewise.
* dwarf2out.c (have_macinfo): Define. * dwarf2out.c (have_macinfo): Define.
(dwarf2out_finish): Don't emit DW_AT_GNU_macros or DW_AT_macro_info (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 attribute, don't force empty compilation unit and don't emit any
......
...@@ -20110,7 +20110,7 @@ dwarf2out_define (unsigned int lineno ATTRIBUTE_UNUSED, ...@@ -20110,7 +20110,7 @@ dwarf2out_define (unsigned int lineno ATTRIBUTE_UNUSED,
macinfo_entry e; macinfo_entry e;
/* Insert a dummy first entry to be able to optimize the whole /* Insert a dummy first entry to be able to optimize the whole
predefined macro block using DW_MACRO_GNU_transparent_include. */ predefined macro block using DW_MACRO_GNU_transparent_include. */
if (VEC_empty (macinfo_entry, macinfo_table) && lineno == 0) if (VEC_empty (macinfo_entry, macinfo_table) && lineno <= 1)
{ {
e.code = 0; e.code = 0;
e.lineno = 0; e.lineno = 0;
...@@ -20137,7 +20137,7 @@ dwarf2out_undef (unsigned int lineno ATTRIBUTE_UNUSED, ...@@ -20137,7 +20137,7 @@ dwarf2out_undef (unsigned int lineno ATTRIBUTE_UNUSED,
macinfo_entry e; macinfo_entry e;
/* Insert a dummy first entry to be able to optimize the whole /* Insert a dummy first entry to be able to optimize the whole
predefined macro block using DW_MACRO_GNU_transparent_include. */ predefined macro block using DW_MACRO_GNU_transparent_include. */
if (VEC_empty (macinfo_entry, macinfo_table) && lineno == 0) if (VEC_empty (macinfo_entry, macinfo_table) && lineno <= 1)
{ {
e.code = 0; e.code = 0;
e.lineno = 0; e.lineno = 0;
...@@ -20276,13 +20276,13 @@ optimize_macinfo_range (unsigned int idx, VEC (macinfo_entry, gc) *files, ...@@ -20276,13 +20276,13 @@ optimize_macinfo_range (unsigned int idx, VEC (macinfo_entry, gc) *files,
/* Optimize only if there are at least two consecutive define/undef ops, /* Optimize only if there are at least two consecutive define/undef ops,
and either all of them are before first DW_MACINFO_start_file and either all of them are before first DW_MACINFO_start_file
with lineno 0 (i.e. predefined macro block), or all of them are with lineno {0,1} (i.e. predefined macro block), or all of them are
in some included header file. */ in some included header file. */
if (second->code != DW_MACINFO_define && second->code != DW_MACINFO_undef) if (second->code != DW_MACINFO_define && second->code != DW_MACINFO_undef)
return 0; return 0;
if (VEC_empty (macinfo_entry, files)) if (VEC_empty (macinfo_entry, files))
{ {
if (first->lineno != 0 || second->lineno != 0) if (first->lineno > 1 || second->lineno > 1)
return 0; return 0;
} }
else if (first->lineno == 0) else if (first->lineno == 0)
...@@ -20295,7 +20295,7 @@ optimize_macinfo_range (unsigned int idx, VEC (macinfo_entry, gc) *files, ...@@ -20295,7 +20295,7 @@ optimize_macinfo_range (unsigned int idx, VEC (macinfo_entry, gc) *files,
for (i = idx; VEC_iterate (macinfo_entry, macinfo_table, i, cur); i++) for (i = idx; VEC_iterate (macinfo_entry, macinfo_table, i, cur); i++)
if (cur->code != DW_MACINFO_define && cur->code != DW_MACINFO_undef) if (cur->code != DW_MACINFO_define && cur->code != DW_MACINFO_undef)
break; break;
else if (first->lineno == 0 && cur->lineno != 0) else if (VEC_empty (macinfo_entry, files) && cur->lineno > 1)
break; break;
else else
{ {
...@@ -20309,7 +20309,7 @@ optimize_macinfo_range (unsigned int idx, VEC (macinfo_entry, gc) *files, ...@@ -20309,7 +20309,7 @@ optimize_macinfo_range (unsigned int idx, VEC (macinfo_entry, gc) *files,
/* From the containing include filename (if any) pick up just /* From the containing include filename (if any) pick up just
usable characters from its basename. */ usable characters from its basename. */
if (first->lineno == 0) if (VEC_empty (macinfo_entry, files))
base = ""; base = "";
else else
base = lbasename (VEC_last (macinfo_entry, files)->info); base = lbasename (VEC_last (macinfo_entry, files)->info);
......
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