Commit 584e5527 by Richard Sandiford Committed by Richard Sandiford

iris5.h (ASM_OUTPUT_ASCII): Use mips_output_ascii to put the original string in a comment.

	* config/mips/iris5.h (ASM_OUTPUT_ASCII): Use mips_output_ascii to
	put the original string in a comment.
	* config/mips/mips-protos.h (mips_output_ascii): Add prefix argument.
	* config/mips/mips.c (mips_output_ascii): Likewise.
	* config/mips/mips.h (ASM_OUTPUT_ASCII): Adjust accordingly.

From-SVN: r77195
parent 9b2b3375
2004-02-03 Richard Sandiford <rsandifo@redhat.com>
* config/mips/iris5.h (ASM_OUTPUT_ASCII): Use mips_output_ascii to
put the original string in a comment.
* config/mips/mips-protos.h (mips_output_ascii): Add prefix argument.
* config/mips/mips.c (mips_output_ascii): Likewise.
* config/mips/mips.h (ASM_OUTPUT_ASCII): Adjust accordingly.
2004-02-03 Kazu Hirata <kazu@cs.umass.edu> 2004-02-03 Kazu Hirata <kazu@cs.umass.edu>
* system.h (GIV_SORT_CRITERION): Poison. * system.h (GIV_SORT_CRITERION): Poison.
......
...@@ -193,13 +193,16 @@ Boston, MA 02111-1307, USA. */ ...@@ -193,13 +193,16 @@ Boston, MA 02111-1307, USA. */
#define MIPS_DEFAULT_GVALUE 0 #define MIPS_DEFAULT_GVALUE 0
/* Some assemblers have a bug that causes backslash escaped chars in .ascii /* Some assemblers have a bug that causes backslash escaped chars in .ascii
to be misassembled, so we just completely avoid it. */ to be misassembled, so avoid it by using .byte instead. Write the original
string in a comment, partly to improve readability and partly for the sake
of scan-assembler-type tests. */
#undef ASM_OUTPUT_ASCII #undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \ #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
do { \ do { \
const unsigned char *s_ = (const unsigned char *)(PTR); \ const unsigned char *s_ = (const unsigned char *)(PTR); \
unsigned len_ = (LEN); \ unsigned len_ = (LEN); \
unsigned i_; \ unsigned i_; \
mips_output_ascii (FILE, (const char *) s_, len_, "\t# "); \
for (i_ = 0; i_ < len_; s_++, i_++) \ for (i_ = 0; i_ < len_; s_++, i_++) \
{ \ { \
if ((i_ % 8) == 0) \ if ((i_ % 8) == 0) \
......
...@@ -101,7 +101,7 @@ extern void irix_output_external_libcall (rtx); ...@@ -101,7 +101,7 @@ extern void irix_output_external_libcall (rtx);
#endif #endif
extern void mips_output_filename (FILE *, const char *); extern void mips_output_filename (FILE *, const char *);
extern void mips_output_lineno (FILE *, int); extern void mips_output_lineno (FILE *, int);
extern void mips_output_ascii (FILE *, const char *, size_t); extern void mips_output_ascii (FILE *, const char *, size_t, const char *);
extern void mips_output_aligned_bss (FILE *, tree, const char *, extern void mips_output_aligned_bss (FILE *, tree, const char *,
unsigned HOST_WIDE_INT, int); unsigned HOST_WIDE_INT, int);
extern void mips_declare_object (FILE *, const char *, const char *, extern void mips_declare_object (FILE *, const char *, const char *,
......
...@@ -5816,17 +5816,20 @@ mips_output_lineno (FILE *stream, int line) ...@@ -5816,17 +5816,20 @@ mips_output_lineno (FILE *stream, int line)
} }
} }
/* Output an ASCII string, in a space-saving way. */ /* Output an ASCII string, in a space-saving way. PREFIX is the string
that should be written before the opening quote, such as "\t.ascii\t"
for real string data or "\t# " for a comment. */
void void
mips_output_ascii (FILE *stream, const char *string_param, size_t len) mips_output_ascii (FILE *stream, const char *string_param, size_t len,
const char *prefix)
{ {
size_t i; size_t i;
int cur_pos = 17; int cur_pos = 17;
register const unsigned char *string = register const unsigned char *string =
(const unsigned char *)string_param; (const unsigned char *)string_param;
fprintf (stream, "\t.ascii\t\""); fprintf (stream, "%s\"", prefix);
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
register int c = string[i]; register int c = string[i];
...@@ -5886,7 +5889,7 @@ mips_output_ascii (FILE *stream, const char *string_param, size_t len) ...@@ -5886,7 +5889,7 @@ mips_output_ascii (FILE *stream, const char *string_param, size_t len)
if (cur_pos > 72 && i+1 < len) if (cur_pos > 72 && i+1 < len)
{ {
cur_pos = 17; cur_pos = 17;
fprintf (stream, "\"\n\t.ascii\t\""); fprintf (stream, "\"\n%s\"", prefix);
} }
} }
fprintf (stream, "\"\n"); fprintf (stream, "\"\n");
......
...@@ -3301,7 +3301,7 @@ do { \ ...@@ -3301,7 +3301,7 @@ do { \
/* This is how to output a string. */ /* This is how to output a string. */
#undef ASM_OUTPUT_ASCII #undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(STREAM, STRING, LEN) \ #define ASM_OUTPUT_ASCII(STREAM, STRING, LEN) \
mips_output_ascii (STREAM, STRING, LEN) mips_output_ascii (STREAM, STRING, LEN, "\t.ascii\t")
/* Output #ident as a in the read-only data section. */ /* Output #ident as a in the read-only data section. */
#undef ASM_OUTPUT_IDENT #undef ASM_OUTPUT_IDENT
......
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