diff options
author | Anatoly Sokolov <aesok@post.ru> | 2010-07-26 22:00:17 +0400 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2010-07-26 22:00:17 +0400 |
commit | b5f5d41d1a95994af84eececdb450685d0f1c436 (patch) | |
tree | d56be18415909b5f90b4a54679d77846826cda08 /gcc/varasm.c | |
parent | 114e33e1e6658de6e5a65e5d4bdc8623acb11527 (diff) | |
download | gcc-b5f5d41d1a95994af84eececdb450685d0f1c436.zip gcc-b5f5d41d1a95994af84eececdb450685d0f1c436.tar.gz gcc-b5f5d41d1a95994af84eececdb450685d0f1c436.tar.bz2 |
target.def (output_source_filename): New hook.
* target.def (output_source_filename): New hook.
* doc/tm.texi.in (TARGET_ASM_OUTPUT_SOURCE_FILENAME): Document.
* doc/tm.texi: Regenerate.
* toplev.c (output_file_directive) Remove function.
* toplev.h (output_file_directive) Remove.
* output.h (default_asm_output_source_filename,
output_file_directive): Declare.
* varasm.h (default_asm_output_source_filename,
output_file_directive): New functions.
* config/mips/mips.h (ASM_OUTPUT_SOURCE_FILENAME): Remove macro.
* config/mips/mips-protos.h (mips_output_filename): Remove.
* config/mips/mips.c (mips_output_filename): Make Static.
(TARGET_ASM_OUTPUT_SOURCE_FILENAME): Define.
From-SVN: r162542
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 9a4c193..f43f206 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -7247,6 +7247,47 @@ default_elf_asm_output_external (FILE *file ATTRIBUTE_UNUSED, maybe_assemble_visibility (decl); } +/* The default hook for TARGET_ASM_OUTPUT_SOURCE_FILENAME. */ + +void +default_asm_output_source_filename (FILE *file, const char *name) +{ +#ifdef ASM_OUTPUT_SOURCE_FILENAME + ASM_OUTPUT_SOURCE_FILENAME (file, name); +#else + fprintf (file, "\t.file\t"); + output_quoted_string (file, name); + putc ('\n', file); +#endif +} + +/* Output a file name in the form wanted by System V. */ + +void +output_file_directive (FILE *asm_file, const char *input_name) +{ + int len; + const char *na; + + if (input_name == NULL) + input_name = "<stdin>"; + else + input_name = remap_debug_filename (input_name); + + len = strlen (input_name); + na = input_name + len; + + /* NA gets INPUT_NAME sans directory names. */ + while (na > input_name) + { + if (IS_DIR_SEPARATOR (na[-1])) + break; + na--; + } + + targetm.asm_out.output_source_filename (asm_file, na); +} + /* Create a DEBUG_EXPR_DECL / DEBUG_EXPR pair from RTL expression EXP. */ rtx |