aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorDimitrios Apostolou <jimis@gmx.net>2011-11-11 04:00:39 +0000
committerJason Merrill <jason@gcc.gnu.org>2011-11-10 23:00:39 -0500
commit5e3929ed1b1b079f87d3bdc9342b9f05fa9cfd06 (patch)
tree048365acb120710e3f57953c76b1f455473b434d /gcc/dwarf2out.c
parentc63ee1b7f0785159d2188c2708100fc0e116f27e (diff)
downloadgcc-5e3929ed1b1b079f87d3bdc9342b9f05fa9cfd06.zip
gcc-5e3929ed1b1b079f87d3bdc9342b9f05fa9cfd06.tar.gz
gcc-5e3929ed1b1b079f87d3bdc9342b9f05fa9cfd06.tar.bz2
final.c, output.h (fprint_whex, [...]): New functions serving as fast replacements for fprintf() integer to string...
* final.c, output.h (fprint_whex, fprint_w, fprint_ul, sprint_ul): New functions serving as fast replacements for fprintf() integer to string conversions. They were used in the following changes. * final.c (sprint_ul_rev): Internal helper for the above. (output_addr_const): case CONST_INT: don't use fprintf(). * elfos.h (ASM_GENERATE_INTERNAL_LABEL): Don't use sprintf("%u"), use sprint_ul() and stpcpy() which are much faster. (TARGET_ASM_INTERNAL_LABEL): Define as default_elf_internal_label. (ELF_ASCII_ESCAPES, ELF_STRING_LIMIT): Are the old ESCAPES and STRING_LIMIT macros. (ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII): Macros now just call respective functions that provide the same functionality. Those are default_elf_asm_output_limited_string() and default_elf_asm_output_ascii() in varasm.c. * varasm.c: Fixed some whitespace inconsistencies. (default_elf_asm_output_limited_string) (default_elf_asm_output_ascii): The above macros from elfos.h are implemented here as these functions, avoiding superfluous calls to fprintf(). (default_elf_internal_label): Hook for targetm.asm_out.internal_label and ASM_OUTPUT_DEBUG_LABEL. * i386.c: Don't call fprintf("%u") but fprint_ul() instead. * defaults.h (ASM_OUTPUT_LABEL, ASM_OUTPUT_INTERNAL_LABEL): Expanded the macros on multiple lines for readability. (ASM_OUTPUT_LABELREF): Have two calls to fputs() instead of one to asm_fprintf(). * dwarf2asm.c (dw2_assemble_integer, dw2_asm_output_data) (dw2_asm_data_uleb128, dw2_asm_delta_uleb128) (dw2_asm_delta_sleb128): Convert fprintf() calls to the new faster functions. * dwarf2out.c (dwarf2out_source_line): Convert fprintf() calls to the new faster functions. From-SVN: r181279
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 7b5930e..768ecaf 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -20472,12 +20472,27 @@ dwarf2out_source_line (unsigned int line, const char *filename,
if (DWARF2_ASM_LINE_DEBUG_INFO)
{
/* Emit the .loc directive understood by GNU as. */
- fprintf (asm_out_file, "\t.loc %d %d 0", file_num, line);
+ /* "\t.loc %u %u 0 is_stmt %u discriminator %u",
+ file_num, line, is_stmt, discriminator */
+ fputs ("\t.loc ", asm_out_file);
+ fprint_ul (asm_out_file, file_num);
+ putc (' ', asm_out_file);
+ fprint_ul (asm_out_file, line);
+ putc (' ', asm_out_file);
+ putc ('0', asm_out_file);
+
if (is_stmt != table->is_stmt)
- fprintf (asm_out_file, " is_stmt %d", is_stmt ? 1 : 0);
+ {
+ fputs (" is_stmt ", asm_out_file);
+ putc (is_stmt ? '1' : '0', asm_out_file);
+ }
if (SUPPORTS_DISCRIMINATOR && discriminator != 0)
- fprintf (asm_out_file, " discriminator %d", discriminator);
- fputc ('\n', asm_out_file);
+ {
+ gcc_assert (discriminator > 0);
+ fputs (" discriminator ", asm_out_file);
+ fprint_ul (asm_out_file, (unsigned long) discriminator);
+ }
+ putc ('\n', asm_out_file);
}
else
{