Patchwork [MMIX] Hookize ASM_OUTPUT_SOURCE_FILENAME

login
register
mail settings
Submitter Anatoly Sokolov
Date July 30, 2010, 3:26 p.m.
Message ID <1672897397.20100730192600@post.ru>
Download mbox | patch
Permalink /patch/60361/
State New
Headers show

Comments

Anatoly Sokolov - July 30, 2010, 3:26 p.m.
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.

        


Anatoly.
Richard Henderson - July 30, 2010, 3:56 p.m.
On 07/30/2010 08:26 AM, Anatoly Sokolov wrote:
> +#include "basic-block.h"

Presumably this is to fix some pre-existing build error?

If so, then please commit this independently and the patch is ok.


r~
Anatoly Sokolov - July 30, 2010, 4:01 p.m.
> On 07/30/2010 08:26 AM, Anatoly Sokolov wrote:
>> +#include "basic-block.h"
> 
> Presumably this is to fix some pre-existing build error?

Yes.

> 
> If so, then please commit this independently and the patch is ok.
> 

Ok.

Anatoly.

Patch

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 ");