This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[MMIX] Hookize ASM_OUTPUT_SOURCE_FILENAME
- From: Anatoly Sokolov <aesok at post dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Cc: hp at bitrange dot com
- Date: Fri, 30 Jul 2010 19:26:00 +0400
- Subject: [MMIX] Hookize ASM_OUTPUT_SOURCE_FILENAME
Hi.
This patch removes obsolete ASM_OUTPUT_SOURCE_FILENAME macro from MMIX back
end in the GCC and introduces equivalent TARGET_ASM_OUTPUT_SOURCE_FILENAME
target hooks.
Regression tested on mmix-knuth-mmixware.
OK to install?
* config/mmix/mmix.h (ASM_OUTPUT_SOURCE_FILENAME): Remove macro.
* config/mmix/mmix-protos.h (mmix_asm_output_source_filename): Remove.
* config/mmix/mmix.c: Include basic-block.h.
(mmix_asm_output_source_filename): Make static.
(TARGET_ASM_OUTPUT_SOURCE_FILENAME): Define.
Index: gcc/config/mmix/mmix.h
===================================================================
--- gcc/config/mmix/mmix.h (revision 162620)
+++ gcc/config/mmix/mmix.h (working copy)
@@ -726,9 +726,6 @@
#define ASM_APP_ON "%APP\n"
#define ASM_APP_OFF "%NO_APP\n"
-#define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
- mmix_asm_output_source_filename (STREAM, NAME)
-
#define OUTPUT_QUOTED_STRING(STREAM, STRING) \
mmix_output_quoted_string (STREAM, STRING, strlen (STRING))
Index: gcc/config/mmix/mmix-protos.h
===================================================================
--- gcc/config/mmix/mmix-protos.h (revision 162620)
+++ gcc/config/mmix/mmix-protos.h (working copy)
@@ -31,7 +31,6 @@
(enum machine_mode, enum reg_class, enum reg_class);
extern const char *mmix_text_section_asm_op (void);
extern const char *mmix_data_section_asm_op (void);
-extern void mmix_asm_output_source_filename (FILE *, const char *);
extern void mmix_output_quoted_string (FILE *, const char *, int);
extern void mmix_asm_output_source_line (FILE *, int);
extern void mmix_asm_output_ascii (FILE *, const char *, int);
Index: gcc/config/mmix/mmix.c
===================================================================
--- gcc/config/mmix/mmix.c (revision 162620)
+++ gcc/config/mmix/mmix.c (working copy)
@@ -30,6 +30,7 @@
#include "hashtab.h"
#include "insn-config.h"
#include "output.h"
+#include "basic-block.h"
#include "flags.h"
#include "tree.h"
#include "function.h"
@@ -112,6 +113,7 @@
/* Intermediate for insn output. */
static int mmix_output_destination_register;
+static void mmix_asm_output_source_filename (FILE *, const char *);
static void mmix_output_shiftvalue_op_from_str
(FILE *, const char *, HOST_WIDEST_INT);
static void mmix_output_shifted_value (FILE *, HOST_WIDEST_INT);
@@ -188,6 +190,8 @@
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END mmix_file_end
+#undef TARGET_ASM_OUTPUT_SOURCE_FILENAME
+#define TARGET_ASM_OUTPUT_SOURCE_FILENAME mmix_asm_output_source_filename
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS mmix_rtx_costs
@@ -1244,9 +1248,9 @@
switch_to_section (data_section);
}
-/* ASM_OUTPUT_SOURCE_FILENAME. */
+/* TARGET_ASM_OUTPUT_SOURCE_FILENAME. */
-void
+static void
mmix_asm_output_source_filename (FILE *stream, const char *name)
{
fprintf (stream, "# 1 ");
Anatoly.