summaryrefslogtreecommitdiff
path: root/gcc/dwarf2asm.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-11 04:00:39 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-11 04:00:39 +0000
commitc0e76f1fce1aa6274b2e04988b81309a453eb6eb (patch)
tree048365acb120710e3f57953c76b1f455473b434d /gcc/dwarf2asm.c
parent15a4d99d7f699f35bcf8173219e53765c509e5bf (diff)
downloadgcc-c0e76f1fce1aa6274b2e04988b81309a453eb6eb.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181279 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2asm.c')
-rw-r--r--gcc/dwarf2asm.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
index 0b7480ba3c4..fe305d3ed4e 100644
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -47,8 +47,7 @@ dw2_assemble_integer (int size, rtx x)
{
fputs (op, asm_out_file);
if (CONST_INT_P (x))
- fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX,
- (unsigned HOST_WIDE_INT) INTVAL (x));
+ fprint_whex (asm_out_file, (unsigned HOST_WIDE_INT) INTVAL (x));
else
output_addr_const (asm_out_file, x);
}
@@ -100,16 +99,19 @@ dw2_asm_output_data (int size, unsigned HOST_WIDE_INT value,
value &= ~(~(unsigned HOST_WIDE_INT) 0 << (size * 8));
if (op)
- fprintf (asm_out_file, "%s" HOST_WIDE_INT_PRINT_HEX, op, value);
+ {
+ fputs (op, asm_out_file);
+ fprint_whex (asm_out_file, value);
+ }
else
assemble_integer (GEN_INT (value), size, BITS_PER_UNIT, 1);
if (flag_debug_asm && comment)
{
- fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ fputs ("\t" ASM_COMMENT_START " ", asm_out_file);
vfprintf (asm_out_file, comment, ap);
}
- fputc ('\n', asm_out_file);
+ putc ('\n', asm_out_file);
va_end (ap);
}
@@ -590,7 +592,8 @@ dw2_asm_output_data_uleb128 (unsigned HOST_WIDE_INT value,
va_start (ap, comment);
#ifdef HAVE_AS_LEB128
- fprintf (asm_out_file, "\t.uleb128 " HOST_WIDE_INT_PRINT_HEX , value);
+ fputs ("\t.uleb128 ", asm_out_file);
+ fprint_whex (asm_out_file, value);
if (flag_debug_asm && comment)
{
@@ -635,7 +638,7 @@ dw2_asm_output_data_uleb128 (unsigned HOST_WIDE_INT value,
}
}
#endif
- fputc ('\n', asm_out_file);
+ putc ('\n', asm_out_file);
va_end (ap);
}
@@ -739,7 +742,7 @@ dw2_asm_output_delta_uleb128 (const char *lab1 ATTRIBUTE_UNUSED,
#ifdef HAVE_AS_LEB128
fputs ("\t.uleb128 ", asm_out_file);
assemble_name (asm_out_file, lab1);
- fputc ('-', asm_out_file);
+ putc ('-', asm_out_file);
assemble_name (asm_out_file, lab2);
#else
gcc_unreachable ();
@@ -769,7 +772,7 @@ dw2_asm_output_delta_sleb128 (const char *lab1 ATTRIBUTE_UNUSED,
#ifdef HAVE_AS_LEB128
fputs ("\t.sleb128 ", asm_out_file);
assemble_name (asm_out_file, lab1);
- fputc ('-', asm_out_file);
+ putc ('-', asm_out_file);
assemble_name (asm_out_file, lab2);
#else
gcc_unreachable ();