diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2001-12-17 15:05:40 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2001-12-17 15:05:40 +0000 |
commit | 301d03af8a3cbf51e79ff35c1aa71a6f353709c5 (patch) | |
tree | db00089740b52986d77e25864271a24f731e7688 /gcc/dwarfout.c | |
parent | 00a8c0b430ad9ed836ab88fba25ef2acf16d3a0d (diff) | |
download | gcc-301d03af8a3cbf51e79ff35c1aa71a6f353709c5.zip gcc-301d03af8a3cbf51e79ff35c1aa71a6f353709c5.tar.gz gcc-301d03af8a3cbf51e79ff35c1aa71a6f353709c5.tar.bz2 |
target.h (asm_out.byte_op, [...]): New fields.
* target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op,
asm_out.integer): New fields.
* target-def.h (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_[HSDT]I_OP,
TARGET_ASM_UNALIGNED_[HSDT]I_OP, TARGET_ASM_INTEGER): New initialisers.
(TARGET_ASM_ALIGNED_INT_OP, TARGET_ASM_UNALIGNED_INT_OP): Collect
the individual initialisers together.
(TARGET_ASM_OUT): Add the new initialisers.
* output.h (assemble_integer): Return bool.
(integer_asm_op): Declare.
(default_assemble_integer): Declare.
(assemble_aligned_integer): New interface to assemble_integer.
* varasm.c (integer_asm_op): New function to select pseudo-op.
(default_assemble_integer): Default implementation of asm_out.integer.
(assemble_integer): Use the new target hook. Split objects into
words or bytes if the target hook fails. Return bool.
* doc/tm.texi (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_SHORT,
ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_OUTPUT_QUADRUPLE_INT,
UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP,
UNALIGNED_DOUBLE_INT_ASM_OP): Undocument.
Document new target hooks.
* defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Use integer_asm_op.
* dwarf2asm.c (unaligned_integer_asm_op): Remove.
(dw2_assemble_integer): New.
(dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset,
dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx,
dw2_asm_output_encoded_addr_rtx): Use it.
(dw2_asm_output_nstring): Use assemble_integer for the null terminator.
(dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128): Use
integer_asm_op to get the byte pseudo-op. Use assemble_integer
if it returns NULL.
* dwarf2asm.h (dw2_assemble_integer): Declare.
* dwarfout.c: Include dwarf2asm.h. Use dwarf2 functions for the
default implementation of most macros.
(output_unsigned_leb128): Use dw2_asm_output_data.
(output_signed_leb128, dwarfout_source_line): Likewise.
(output_reg_number): Use dw2_assemble_integer.
(generate_macinfo_entry): Separate the type and offset arguments.
Use assemble_integer to write the value.
(dwarfout_start_source_file): Update generate_macinfo_entry usage.
(dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Likewise.
* final.c (output_addr_const): Don't put brackets round a subtracted
symbol value or ".".
* halfpic.c (half_pic_finish): Use assemble_aligned_integer.
* config/1750a/1750a.c (assemble_integer_1750a): New,
* config/alpha/alpha.h (literal_section): Avoid ASM_OUTPUT_INT.
* config/arc/arc.c (arc_assemble_integer): New.
* config/arc/arc.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT.
* config/arm/arm.c (arm_poke_function_name): Likewise.
(arm_assemble_integer): New, extracted from...
* config/arm/arm.h (OUTPUT_INT_ADDR_CONST): ...here, now removed.
(ARM_TRAMPOLINE_TEMPLATE, ARM_FUNCTION_PROFILER): Avoid ASM_OUTPUT_INT.
(ARM_FUNCTION_PROFILER): Likewise.
* config/avr/avr-protos.h (asm_output_byte): Remove.
(asm_output_char, asm_output_short): Remove.
* config/avr/avr.c (avr_assemble_integer): New.
(asm_output_byte, asm_output_char, asm_output_short): Remove.
* config/clipper/clipper.h (ASM_LONG): Remove.
* config/dsp16xx/dsp16xx-protos.h (asm_output_long): Remove.
* config/dsp16xx/dsp16xx.c (asm_output_long): Remove.
* config/elxsi/elxsi.c (elxsi_assemble_integer): New.
* config/i370/i370.c (i370_hlasm_assemble_integer): New.
* config/i370/i370.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT.
(ASM_BYTE, ASM_SHORT, ASM_LONG): Delete.
* config/i386/att.h, (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use
ASM_LONG instead of UNALIGNED_INT_ASM_OP.
* config/i386/sco5.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise.
(ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/i386/sysv4.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use
ASM_LONG instead of UNALIGNED_INT_ASM_OP.
* config/i860/fx2800.h (ASM_FILE_END): Avoid ASM_LONG.
* config/i860/i860.c (i860_output_function_epilogue): Likewise.
* config/i860/i860.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT.
(ASM_SHORT, ASM_LONG): Undefine.
* config/i860/paragon.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* config/i960/i960.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT.
* config/ia64/ia64.c (ia64_assemble_integer): New.
* config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use integer_asm_op.
(ASM_OUTPUT_DWARF_PCREL): Likewise.
* config/m68hc11/m68hc11.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT,
ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT): Avoid ASM_LONG.
(ASM_SHORT, ASM_LONG): Remove.
* config/m68k/m68k.h (INT_OP_GROUP): New macro.
(INT_OP_STANDARD, INT_OP_DOT_WORD, INT_OP_NO_DOT, INT_OP_DC): New
macros, the allowed values for INT_OP_GROUP.
* config/m68k/amix.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP
* config/m68k/atari.h (ASM_OUTPUT_ASCII): Likewise
* config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Likewise
* config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove.
(INT_OP_GROUP): Define to INT_OP_NO_DOT.
* config/m68k/dpx2.h (ASM_LONG): Undefine.
(INT_OP_GROUP): Define to INT_OP_DC.
* config/m68k/dpx2g.h (ASM_LONG): Undefine.
* config/m68k/hp320.h (INT_OP_GROUP): Define to INT_OP_NO_DOT.
* config/m68k/lynx.h (ASM_LONG): Undefine.
* config/m68k/dpx2g.h (ASM_LONG): Undefine.
* config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise.
(TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_*.
* config/m68k/mot3300.h (INT_OP_GROUP): Define to INT_OP_STANDARD
for GAS and INT_OP_NO_DOT otherwise.
(ASM_CHAR, ASM_BYTE, ASM_SHORT, ASM_LONG): Remove.
(ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT,
ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid ASM_LONG.
(ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove.
(INT_OP_GROUP): Define to INT_OP_STANDARD.
(ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT,
ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid LONG_ASM_OP.
(ASM_OUTPUT_ASCII): Avoid BYTE_ASM_OP.
* config/m68k/tower-as.h (ASM_LONG): Remove.
(INT_OP_GROUP): Define to INT_OP_NO_DOT.
* config/m88k/m88k.c (output_tdesc): Avoid ASM_LONG.
* config/m88k/m88k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT.
(ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG.
* config/mips/iris5.h (TARGET_IRIX5): Define.
* config/mips/mips.c (mips_assemble_integer): New.
* config/mips/sni-svr4.h (ASM_LONG): Undefine.
* config/mmix/mmix-protos.h (mmix_asm_output_double_int): Remove.
* config/mmix/mmix.c (mmix_assemble_integer): New.
(mmix_asm_output_double_int): Remove.
(mmix_print_operand): Call mmix_output_octa directly.
* config/mmix/mmix.h (ASM_LONG): Remove.
* config/ns32k/ns32k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT.
* config/pa/pa.c (pa_assemble_integer): New.
(pa_override_options): Only use aligned DI ops on 64-bit targets.
Only use the unaligned ops if TARGET_GAS.
* config/pdp11/pdp11.c (pdp11_assemble_integer): New.
* config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT.
* config/pj/pj.h (ASM_LONG): Undefine.
* config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Undefine.
* config/rs6000/rs6000.c (rs6000_assemble_integer): New, mostly
extracted from ASM_OUTPUT_INT in sysv4.h. Use in_text_section()
and in_toc_section() rather than the in_section variable.
(rs6000_override_options): Only use DI ops when TARGET_POWERPC64.
* config/rs6000/sysv4.h (TOC_SECTION_FUNCTION): Add in_toc_section().
(RELOCATABLE_NEEDS_FIXUP): Define.
* config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Change space to tab.
* config/s390/linux.h (ASM_SHORT, ASM_LONG, ASM_QUAD): Remove.
(ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use integer_asm_op
to get the word directive.
(ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/s390/s390.c (s390_assemble_integer): New.
* config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Use
integer_asm_op to get the word directive.
* config/sparc/sol2.h (ASM_SHORT, ASM_LONG): Remove.
* config/sparc/sparc-protos.h (output_double_int): Remove.
* config/sparc/sparc.c (output_double_int): Move to...
(sparc_assemble_integer): ...this new function.
(sparc_override_options): Only use .uaxword if TARGET_ARCH64.
* config/sparc/sparc.h (ASM_SHORT, ASM_LONG, ASM_LONGLONG): Remove.
* config/sparc/sysv4.h (ASM_LONG): Remove.
(ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid
ASM_LONG.
* config/vax/vax.h (TRAMPOLINE_TEMPLATE): Use assemble_aligned_integer.
* config/we32k/we32k.h (TRAMPOLINE_TEMPLATE): Likewise.
* config/1750a/1750a.c, config/a29k/a29k.c, config/alpha/alpha.c,
config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c,
config/clipper/clipper.c, config/convex/convex.c, config/cris/cris.c,
config/d30v/d30v.c, config/dsp16xx/dsp16xx.c, config/elxsi/elxsi.c,
config/fr30/fr30.c, config/h8300/h8300.c, config/i370/i370.c,
config/i386/i386.c, config/i860/i860.c, config/i960/i960.c,
config/ia64/ia64.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/m88k/m88k.c, config/mips/mips.c,
config/mmix/mmix.c, config/mn10200/mn10200.c, config/mn10300/mn10300.c,
config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c,
config/sh/sh.c, config/sparc/sparc.c, config/stormy16/stormy16.c,
config/v850/v850.c, config/vax/vax.c, config/we32k/we32k.c
(TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_HI_OP,
TARGET_ASM_ALIGNED_SI_OP, TARGET_ASM_ALIGNED_DI_OP,
TARGET_ASM_UNALIGNED_HI_OP, TARGET_ASM_UNALIGNED_SI_OP,
TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_INTEGER): Redefine as
appropriate.
* config/defaults.h, config/darwin.h, config/elfos.h, config/svr3.h,
config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h,
config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h,
config/clipper/clipper.h, config/convex/convex.h, config/cris/cris.h,
config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h,
config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h,
config/i386/bsd.h, config/i386/djgpp.h, config/i386/i386.h,
config/i386/sco5.h, config/i386/sol2.h, config/i386/sun386.h,
config/i860/i860.h, config/i960/i960.h, config/ia64/ia64.h,
config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/auxas.h,
config/m68k/dpx2.h, config/m68k/hp320.h, config/m68k/m68k.h,
config/m68k/mot3300.h, config/m68k/sgs.h, config/m68k/tower-as.h,
config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore.h,
config/mips/iris5.h, config/mips/iris6.h, config/mips/mips.h,
config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h
config/ns32k/encore.h, config/ns32k/ns32k.h, config/pa/pa-64.h,
config/pa/pa.h, config/pdp11/pdp11.h, config/pj/pj.h,
config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/rs6000.h,
config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/linux.h,
config/sh/sh.h, config/sparc/linux64.h, config/sparc/sol2.h,
config/sparc/sp64-elf.h, config/sparc/sparc.h, config/sparc/sysv4.h,
config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h,
config/we32k/we32k.h (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_BYTE_OP,
ASM_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT,
UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP,
UNALIGNED_DOUBLE_INT_ASM_OP): Undefine, where defined.
From-SVN: r48101
Diffstat (limited to 'gcc/dwarfout.c')
-rw-r--r-- | gcc/dwarfout.c | 165 |
1 files changed, 40 insertions, 125 deletions
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index 3edaf35..0ff75f5 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -574,6 +574,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "insn-config.h" #include "reload.h" #include "output.h" +#include "dwarf2asm.h" #include "toplev.h" #include "tm_p.h" #include "debug.h" @@ -928,7 +929,8 @@ static void shuffle_filename_entry PARAMS ((filename_entry *)); static void generate_new_sfname_entry PARAMS ((void)); static unsigned lookup_filename PARAMS ((const char *)); static void generate_srcinfo_entry PARAMS ((unsigned, unsigned)); -static void generate_macinfo_entry PARAMS ((const char *, const char *)); +static void generate_macinfo_entry PARAMS ((unsigned int, rtx, + const char *)); static int is_pseudo_reg PARAMS ((rtx)); static tree type_main_variant PARAMS ((tree)); static int is_tagged_type PARAMS ((tree)); @@ -1207,147 +1209,77 @@ static void retry_incomplete_types PARAMS ((void)); #ifndef ASM_OUTPUT_DWARF_DELTA2 #define ASM_OUTPUT_DWARF_DELTA2(FILE,LABEL1,LABEL2) \ - do { fprintf ((FILE), "%s", UNALIGNED_SHORT_ASM_OP); \ - assemble_name (FILE, LABEL1); \ - fprintf (FILE, "-"); \ - assemble_name (FILE, LABEL2); \ - fprintf (FILE, "\n"); \ - } while (0) + dw2_asm_output_delta (2, LABEL1, LABEL2, NULL) #endif #ifndef ASM_OUTPUT_DWARF_DELTA4 #define ASM_OUTPUT_DWARF_DELTA4(FILE,LABEL1,LABEL2) \ - do { fprintf ((FILE), "%s", UNALIGNED_INT_ASM_OP); \ - assemble_name (FILE, LABEL1); \ - fprintf (FILE, "-"); \ - assemble_name (FILE, LABEL2); \ - fprintf (FILE, "\n"); \ - } while (0) + dw2_asm_output_delta (4, LABEL1, LABEL2, NULL) #endif #ifndef ASM_OUTPUT_DWARF_TAG #define ASM_OUTPUT_DWARF_TAG(FILE,TAG) \ - do { \ - fprintf ((FILE), "%s0x%x", \ - UNALIGNED_SHORT_ASM_OP, (unsigned) TAG); \ - if (flag_debug_asm) \ - fprintf ((FILE), "\t%s %s", \ - ASM_COMMENT_START, dwarf_tag_name (TAG)); \ - fputc ('\n', (FILE)); \ - } while (0) + dw2_asm_output_data (2, TAG, "%s", dwarf_tag_name (TAG)); #endif #ifndef ASM_OUTPUT_DWARF_ATTRIBUTE #define ASM_OUTPUT_DWARF_ATTRIBUTE(FILE,ATTR) \ - do { \ - fprintf ((FILE), "%s0x%x", \ - UNALIGNED_SHORT_ASM_OP, (unsigned) ATTR); \ - if (flag_debug_asm) \ - fprintf ((FILE), "\t%s %s", \ - ASM_COMMENT_START, dwarf_attr_name (ATTR)); \ - fputc ('\n', (FILE)); \ - } while (0) + dw2_asm_output_data (2, ATTR, "%s", dwarf_attr_name (ATTR)) #endif #ifndef ASM_OUTPUT_DWARF_STACK_OP #define ASM_OUTPUT_DWARF_STACK_OP(FILE,OP) \ - do { \ - fprintf ((FILE), "%s0x%x", ASM_BYTE_OP, (unsigned) OP); \ - if (flag_debug_asm) \ - fprintf ((FILE), "\t%s %s", \ - ASM_COMMENT_START, dwarf_stack_op_name (OP)); \ - fputc ('\n', (FILE)); \ - } while (0) + dw2_asm_output_data (1, OP, "%s", dwarf_stack_op_name (OP)) #endif #ifndef ASM_OUTPUT_DWARF_FUND_TYPE #define ASM_OUTPUT_DWARF_FUND_TYPE(FILE,FT) \ - do { \ - fprintf ((FILE), "%s0x%x", \ - UNALIGNED_SHORT_ASM_OP, (unsigned) FT); \ - if (flag_debug_asm) \ - fprintf ((FILE), "\t%s %s", \ - ASM_COMMENT_START, dwarf_fund_type_name (FT)); \ - fputc ('\n', (FILE)); \ - } while (0) + dw2_asm_output_data (2, FT, "%s", dwarf_fund_type_name (FT)) #endif #ifndef ASM_OUTPUT_DWARF_FMT_BYTE #define ASM_OUTPUT_DWARF_FMT_BYTE(FILE,FMT) \ - do { \ - fprintf ((FILE), "%s0x%x", ASM_BYTE_OP, (unsigned) FMT); \ - if (flag_debug_asm) \ - fprintf ((FILE), "\t%s %s", \ - ASM_COMMENT_START, dwarf_fmt_byte_name (FMT)); \ - fputc ('\n', (FILE)); \ - } while (0) + dw2_asm_output_data (1, FMT, "%s", dwarf_fmt_byte_name (FMT)); #endif #ifndef ASM_OUTPUT_DWARF_TYPE_MODIFIER #define ASM_OUTPUT_DWARF_TYPE_MODIFIER(FILE,MOD) \ - do { \ - fprintf ((FILE), "%s0x%x", ASM_BYTE_OP, (unsigned) MOD); \ - if (flag_debug_asm) \ - fprintf ((FILE), "\t%s %s", \ - ASM_COMMENT_START, dwarf_typemod_name (MOD)); \ - fputc ('\n', (FILE)); \ - } while (0) + dw2_asm_output_data (1, MOD, "%s", dwarf_typemod_name (MOD)); #endif #ifndef ASM_OUTPUT_DWARF_ADDR #define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \ - do { fprintf ((FILE), "%s", UNALIGNED_INT_ASM_OP); \ - assemble_name (FILE, LABEL); \ - fprintf (FILE, "\n"); \ - } while (0) + dw2_asm_output_addr (4, LABEL, NULL) #endif #ifndef ASM_OUTPUT_DWARF_ADDR_CONST #define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX) \ - do { \ - fprintf ((FILE), "%s", UNALIGNED_INT_ASM_OP); \ - output_addr_const ((FILE), (RTX)); \ - fputc ('\n', (FILE)); \ - } while (0) + dw2_asm_output_addr_rtx (4, RTX, NULL) #endif #ifndef ASM_OUTPUT_DWARF_REF #define ASM_OUTPUT_DWARF_REF(FILE,LABEL) \ - do { fprintf ((FILE), "%s", UNALIGNED_INT_ASM_OP); \ - assemble_name (FILE, LABEL); \ - fprintf (FILE, "\n"); \ - } while (0) + dw2_asm_output_addr (4, LABEL, NULL) #endif #ifndef ASM_OUTPUT_DWARF_DATA1 #define ASM_OUTPUT_DWARF_DATA1(FILE,VALUE) \ - fprintf ((FILE), "%s0x%x\n", ASM_BYTE_OP, VALUE) + dw2_asm_output_data (1, VALUE, NULL) #endif #ifndef ASM_OUTPUT_DWARF_DATA2 #define ASM_OUTPUT_DWARF_DATA2(FILE,VALUE) \ - fprintf ((FILE), "%s0x%x\n", UNALIGNED_SHORT_ASM_OP, (unsigned) VALUE) + dw2_asm_output_data (2, VALUE, NULL) #endif #ifndef ASM_OUTPUT_DWARF_DATA4 #define ASM_OUTPUT_DWARF_DATA4(FILE,VALUE) \ - fprintf ((FILE), "%s0x%x\n", UNALIGNED_INT_ASM_OP, (unsigned) VALUE) + dw2_asm_output_data (4, VALUE, NULL) #endif #ifndef ASM_OUTPUT_DWARF_DATA8 #define ASM_OUTPUT_DWARF_DATA8(FILE,HIGH_VALUE,LOW_VALUE) \ - do { \ - if (WORDS_BIG_ENDIAN) \ - { \ - fprintf ((FILE), "%s0x%x\n", UNALIGNED_INT_ASM_OP, HIGH_VALUE); \ - fprintf ((FILE), "%s0x%x\n", UNALIGNED_INT_ASM_OP, LOW_VALUE); \ - } \ - else \ - { \ - fprintf ((FILE), "%s0x%x\n", UNALIGNED_INT_ASM_OP, LOW_VALUE); \ - fprintf ((FILE), "%s0x%x\n", UNALIGNED_INT_ASM_OP, HIGH_VALUE); \ - } \ - } while (0) + dw2_asm_output_data (8, VALUE, NULL) #endif /* ASM_OUTPUT_DWARF_STRING is defined to output an ascii string, but to @@ -1757,11 +1689,8 @@ output_unsigned_leb128 (value) value >>= 7; if (value != 0) /* more bytes to follow */ byte |= 0x80; - fprintf (asm_out_file, "%s0x%x", ASM_BYTE_OP, (unsigned) byte); - if (flag_debug_asm && value == 0) - fprintf (asm_out_file, "\t%s ULEB128 number - value = %lu", - ASM_COMMENT_START, orig_value); - fputc ('\n', asm_out_file); + dw2_asm_output_data (1, byte, "\t%s ULEB128 number - value = %lu", + orig_value); } while (value != 0); } @@ -1789,11 +1718,8 @@ output_signed_leb128 (value) byte |= 0x80; more = 1; } - fprintf (asm_out_file, "%s0x%x", ASM_BYTE_OP, (unsigned) byte); - if (flag_debug_asm && more == 0) - fprintf (asm_out_file, "\t%s SLEB128 number - value = %ld", - ASM_COMMENT_START, orig_value); - fputc ('\n', asm_out_file); + dw2_asm_output_data (1, byte, "\t%s SLEB128 number - value = %ld", + orig_value); } while (more); } @@ -2168,8 +2094,7 @@ output_reg_number (rtl) regno); regno = 0; } - fprintf (asm_out_file, "%s0x%x", - UNALIGNED_INT_ASM_OP, DBX_REGISTER_NUMBER (regno)); + dw2_assemble_integer (4, GEN_INT (DBX_REGISTER_NUMBER (regno))); if (flag_debug_asm) { fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START); @@ -6160,9 +6085,7 @@ dwarfout_source_line (line, filename) filename = tail; } - fprintf (asm_out_file, "%s%u\t%s %s:%u\n", - UNALIGNED_INT_ASM_OP, line, ASM_COMMENT_START, - filename, line); + dw2_asm_output_data (4, line, "%s:%u", filename, line); ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0xffff); ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, label, TEXT_BEGIN_LABEL); ASM_OUTPUT_POP_SECTION (asm_out_file); @@ -6176,8 +6099,9 @@ dwarfout_source_line (line, filename) /* Generate an entry in the .debug_macinfo section. */ static void -generate_macinfo_entry (type_and_offset, string) - const char *type_and_offset; +generate_macinfo_entry (type, offset, string) + unsigned int type; + rtx offset; const char *string; { if (! use_gnu_debug_info_extensions) @@ -6185,7 +6109,8 @@ generate_macinfo_entry (type_and_offset, string) fputc ('\n', asm_out_file); ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); - fprintf (asm_out_file, "%s%s\n", UNALIGNED_INT_ASM_OP, type_and_offset); + assemble_integer (gen_rtx_PLUS (SImode, GEN_INT (type << 24), offset), + 4, BITS_PER_UNIT, 1); ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, string); ASM_OUTPUT_POP_SECTION (asm_out_file); } @@ -6206,15 +6131,16 @@ dwarfout_start_source_file (line, filename) const char *filename; { char label[MAX_ARTIFICIAL_LABEL_BYTES]; - char type_and_offset[MAX_ARTIFICIAL_LABEL_BYTES*3]; + const char *label1, *label2; sprintf (label, SFNAMES_ENTRY_LABEL_FMT, lookup_filename (filename)); - sprintf (type_and_offset, "0x%08x+%s-%s", - ((unsigned) MACINFO_start << 24), - /* Hack: skip leading '*' . */ - (*label == '*') + label, - (*SFNAMES_BEGIN_LABEL == '*') + SFNAMES_BEGIN_LABEL); - generate_macinfo_entry (type_and_offset, ""); + label1 = (*label == '*') + label; + label2 = (*SFNAMES_BEGIN_LABEL == '*') + SFNAMES_BEGIN_LABEL; + generate_macinfo_entry (MACINFO_start, + gen_rtx_MINUS (Pmode, + gen_rtx_SYMBOL_REF (Pmode, label1), + gen_rtx_SYMBOL_REF (Pmode, label2)), + ""); } /* Wrapper for toplev.c callback to check debug info level. */ @@ -6230,11 +6156,7 @@ static void dwarfout_end_source_file (lineno) unsigned lineno; { - char type_and_offset[MAX_ARTIFICIAL_LABEL_BYTES*2]; - - sprintf (type_and_offset, "0x%08x+%u", - ((unsigned) MACINFO_resume << 24), lineno); - generate_macinfo_entry (type_and_offset, ""); + generate_macinfo_entry (MACINFO_resume, GEN_INT (lineno), ""); } /* Called from check_newline in c-parse.y. The `buffer' parameter @@ -6248,16 +6170,13 @@ dwarfout_define (lineno, buffer) const char *buffer; { static int initialized = 0; - char type_and_offset[MAX_ARTIFICIAL_LABEL_BYTES*2]; if (!initialized) { dwarfout_start_source_file (0, primary_filename); initialized = 1; } - sprintf (type_and_offset, "0x%08x+%u", - ((unsigned) MACINFO_define << 24), lineno); - generate_macinfo_entry (type_and_offset, buffer); + generate_macinfo_entry (MACINFO_define, GEN_INT (lineno), buffer); } /* Called from check_newline in c-parse.y. The `buffer' parameter @@ -6270,11 +6189,7 @@ dwarfout_undef (lineno, buffer) unsigned lineno; const char *buffer; { - char type_and_offset[MAX_ARTIFICIAL_LABEL_BYTES*2]; - - sprintf (type_and_offset, "0x%08x+%u", - ((unsigned) MACINFO_undef << 24), lineno); - generate_macinfo_entry (type_and_offset, buffer); + generate_macinfo_entry (MACINFO_undef, GEN_INT (lineno), buffer); } /* Set up for Dwarf output at the start of compilation. */ |