diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2003-06-19 21:47:26 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2003-06-19 21:47:26 +0000 |
commit | 1bc7c5b629d70dab15eef0224ab6d9dae0b51b97 (patch) | |
tree | dfd0d874fe0ca79570b8c8107638e443f836c8f4 /gcc/config/i386 | |
parent | b556e18c83e9cf595fa9452a956a4641d1337e52 (diff) | |
download | gcc-1bc7c5b629d70dab15eef0224ab6d9dae0b51b97.tar.gz |
target.h (asm_out.file_start, [...]): New hooks.
* target.h (asm_out.file_start, file_start_app_off,
file_start_file_directive): New hooks.
* target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE,
TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START):
New hook-definition macros.
* doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START.
* varasm.c (default_file_start): New.
* output.h: Prototype it.
* toplev.c (init_asm_output): Use targetm.asm_out.file_start.
* system.h: Poison ASM_FILE_START.
* config/alpha/alpha.c (alpha_write_verstamp): Delete.
(alpha_file_start): New, define if !TARGET_ABI_UNICOSMK.
(unicosmk_asm_file_start): Rename unicosmk_file_start,
make static, take no arguments.
(TARGET_ASM_FILE_START, TARGET_ASM_FILE_END,
TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate.
* config/alpha/unicosmk.h: Don't define ASM_FILE_START nor
TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in
comment.
* config/arc/arc.c (arc_asm_file_start): Rename
arc_file_start, take no arguments, make static.
(TARGET_ASM_FILE_START): Set it.
* config/arm/arm.c (aof_file_start): New static function.
(TARGET_ASM_FILE_START): Set it, when appropriate.
* config/arm/coff.h, config/arm/elf.h:
Set TARGET_ASM_FILE_START_APP_OFF to true.
* config/avr/avr.c (asm_file_start): Rename avr_file_start,
take no arguments, make static.
(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE):
Set them.
* config/c4x/c4x.c (c4x_file_start): New static function.
(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE):
Set them.
* config/cris/cris.c (cris_file_start): New static function.
(TARGET_ASM_FILE_START): Set it.
* config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename
dsp16xx_file_start, make static.
(luxworks_dsp16xx_file_start): Delete.
(TARGET_ASM_FILE_START): Set it.
* config/h8300/h8300.c (asm_file_start): Rename
h8300_file_start, make static, take no arguments.
(TARGET_ASM_FILE_START): Set it.
* config/i370/i370.c (i370_file_start): New static function.
(TARGET_ASM_FILE_START): Set it.
* config/i386/i386.c (x86_file_start): New static function.
(TARGET_ASM_FILE_START): Set it.
* config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE,
X86_FILE_START_FLTUSED): New macros, default to false.
* config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1.
* config/i386/sysv4.h, config/i386/sco5.h: Override
X86_FILE_START_VERSION_DIRECTIVE to true.
* config/ia64/ia64.c (ia64_file_start): New static function.
(TARGET_ASM_FILE_START): Set it.
(emit_safe_across_calls): Take no arguments.
* config/ia64/ia64.md: Update to match.
* config/m32r/m32r.c (m32r_asm_file_start): Rename
m32r_file_start, make static, take no arguments.
(TARGET_ASM_FILE_START): Set it.
* config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename
m68hc11_file_start, make static, take no arguments.
(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
(print_options): Delete.
* config/m68k/m68k.c (m68k_hp320_file_start): New static function.
(TARGET_ASM_FILE_START_APP_OFF): Set.
* config/m68k/hp320.h: Set TARGET_ASM_FILE_START to
m68k_hp320_file_start.
* config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start):
Make static, take no arguments.
(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
* config/mmix/mmix.c (mmix_asm_file_start): Rename
mmix_file_start, make static, take no arguments.
(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
* config/mn10300/mn10300.c (asm_file_start): Rename
mn10300_file_start, make static, take no arguments.
(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
* config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set.
* config/pa/pa.c (pa_file_start_level, pa_file_start_space,
pa_file_start_file, pa_file_start_mcount, pa_elf_file_start,
pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start,
pa_hpux64_hpas_file_start): New static functions.
* config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start.
* config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to
pa_linux_file_start.
* config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to
pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as
appropriate.
* config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start.
* config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF.
(rs6000_file_start): Make static, take no arguments. Reset
default_cpu under certain conditions.
(rs6000_xcoff_file_start): New function.
* config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set.
* config/rs6000/xcoff.h (TARGET_ASM_FILE_START,
TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override.
* config/sh/sh.c (output_file_start): Rename
sh_file_start, make static, take no arguments. Merge in old
code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF.
(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
* config/sh/sh.c (TARGET_ELF): Define to 0.
* config/sh/elf.h (TARGET_ELF): Redefine to 1.
* config/v850/v850.c (asm_file_start): Delete.
(TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
* config/vax/vax.c (vax_file_start): New static function.
(TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set.
* config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false.
* config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h
* config/i386/att.h, config/i386/gas.h, config/i386/linux.h
* config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h
* config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h
* config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true.
* config/darwin.h, config/elfos.h, config/alpha/elf.h
* config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h
* config/arc/arc.h, config/arm/aof.h, config/arm/aout.h
* config/arm/coff.h, config/arm/elf.h, config/arm/pe.h
* config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h
* config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h
* config/i370/i370.h, config/i386/att.h, config/i386/gas.h
* config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h
* config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h
* config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h
* config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h
* config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h
* config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h
* config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h
* config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h
* config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h
* config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h
* config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START.
* config/alpha/alpha-protos.h, config/arc/arc-protos.h
* config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h
* config/h8300/h8300-protos.h, config/ia64/ia64-protos.h
* config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h
* config/mips/mips-protos.h, config/mmix/mmix-protos.h
* config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h
* config/sh/sh-protos.h, config/v850/v850-protos.h: Update.
* xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h:
Remove reference to ASM_FILE_START in comment.
* config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h
* config/arm/linux-gas.h, config/arm/netbsd-elf.h
* config/arm/netbsd.h: Delete definition of ARM_OS_NAME.
From-SVN: r68229
Diffstat (limited to 'gcc/config/i386')
-rw-r--r-- | gcc/config/i386/att.h | 9 | ||||
-rw-r--r-- | gcc/config/i386/gas.h | 10 | ||||
-rw-r--r-- | gcc/config/i386/i386-interix.h | 12 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 16 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 4 | ||||
-rw-r--r-- | gcc/config/i386/linux.h | 8 | ||||
-rw-r--r-- | gcc/config/i386/sco5.h | 9 | ||||
-rw-r--r-- | gcc/config/i386/sysv4.h | 9 |
8 files changed, 31 insertions, 46 deletions
diff --git a/gcc/config/i386/att.h b/gcc/config/i386/att.h index c95b6ad881e..b51f66b65b2 100644 --- a/gcc/config/i386/att.h +++ b/gcc/config/i386/att.h @@ -45,14 +45,7 @@ do \ } while (0) /* Output at beginning of assembler file. */ -/* The .file command should always begin the output. */ -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ - do { \ - output_file_directive (FILE, main_input_filename); \ - if (ix86_asm_dialect == ASM_INTEL) \ - fputs ("\t.intel_syntax\n", FILE); \ - } while (0) +#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true /* This is how to output an assembler line that says to advance the location counter diff --git a/gcc/config/i386/gas.h b/gcc/config/i386/gas.h index 6dec86e08a4..7104ac3d31b 100644 --- a/gcc/config/i386/gas.h +++ b/gcc/config/i386/gas.h @@ -121,12 +121,4 @@ Boston, MA 02111-1307, USA. */ /* Print opcodes the way that GAS expects them. */ #define GAS_MNEMONICS 1 -/* Output at beginning of assembler file. */ -/* The .file command should always begin the output. */ -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ - do { \ - output_file_directive (FILE, main_input_filename); \ - if (ix86_asm_dialect == ASM_INTEL) \ - fputs ("\t.intel_syntax\n", FILE); \ - } while (0) +#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h index 4d3f8603b43..c58d07ba787 100644 --- a/gcc/config/i386/i386-interix.h +++ b/gcc/config/i386/i386-interix.h @@ -92,16 +92,8 @@ Boston, MA 02111-1307, USA. */ /* The global __fltused is necessary to cause the printf/scanf routines for outputting/inputting floating point numbers to be loaded. Since this is kind of hard to detect, we just do it all the time. */ - -#ifdef ASM_FILE_START -#undef ASM_FILE_START -#endif -#define ASM_FILE_START(FILE) \ - do { fprintf (FILE, "\t.file\t"); \ - output_quoted_string (FILE, dump_base_name); \ - fprintf (FILE, "\n"); \ - fprintf (FILE, ".global\t__fltused\n"); \ - } while (0) +#undef X86_FILE_START_FLTUSED +#define X86_FILE_START_FLTUSED 1 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index bc1604f8d47..8409def0e46 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -829,6 +829,7 @@ static void x86_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree)); static bool x86_can_output_mi_thunk PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree)); +static void x86_file_start PARAMS ((void)); static void ix86_reorg PARAMS ((void)); bool ix86_expand_carry_flag_compare PARAMS ((enum rtx_code, rtx, rtx, rtx*)); @@ -1006,6 +1007,9 @@ static void init_ext_80387_constants PARAMS ((void)); #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK #define TARGET_ASM_CAN_OUTPUT_MI_THUNK x86_can_output_mi_thunk +#undef TARGET_ASM_FILE_START +#define TARGET_ASM_FILE_START x86_file_start + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS ix86_rtx_costs #undef TARGET_ADDRESS_COST @@ -15532,6 +15536,18 @@ x86_output_mi_thunk (file, thunk, delta, vcall_offset, function) } } +static void +x86_file_start () +{ + default_file_start (); + if (X86_FILE_START_VERSION_DIRECTIVE) + fputs ("\t.version\t\"01.01\"\n", asm_out_file); + if (X86_FILE_START_FLTUSED) + fputs ("\t.global\t__fltused\n", asm_out_file); + if (ix86_asm_dialect == ASM_INTEL) + fputs ("\t.intel_syntax\n", asm_out_file); +} + int x86_field_alignment (field, computed) tree field; diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index b8a6b7b035d..cfc96b54f0a 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -3229,6 +3229,10 @@ struct machine_function GTY(()) #define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers) #define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching) +/* Control behavior of x86_file_start. */ +#define X86_FILE_START_VERSION_DIRECTIVE false +#define X86_FILE_START_FLTUSED false + /* Local variables: version-control: t diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h index ae6e8d045c6..98a25a95eaf 100644 --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -25,13 +25,7 @@ Boston, MA 02111-1307, USA. */ /* Output at beginning of assembler file. */ /* The .file command should always begin the output. */ -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ - do { \ - output_file_directive (FILE, main_input_filename); \ - if (ix86_asm_dialect == ASM_INTEL) \ - fputs ("\t.intel_syntax\n", FILE); \ - } while (0) +#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true #define TARGET_VERSION fprintf (stderr, " (i386 Linux/ELF)"); diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h index b4096a7ca40..b53bc21305c 100644 --- a/gcc/config/i386/sco5.h +++ b/gcc/config/i386/sco5.h @@ -44,12 +44,9 @@ Boston, MA 02111-1307, USA. */ #define CTORS_SECTION_ASM_OP "\t.section\t.ctors, \"aw\"" #define DTORS_SECTION_ASM_OP "\t.section\t.dtors, \"aw\"" -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ -do { \ - output_file_directive((FILE),main_input_filename); \ - fprintf ((FILE), "\t.version\t\"01.01\"\n"); \ -} while (0) +#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true +#undef X86_FILE_START_VERSION_DIRECTIVE +#define X86_FILE_START_VERSION_DIRECTIVE true /* A C statement (sans semicolon) to output to the stdio stream FILE the assembler definition of uninitialized global DECL named diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h index 6b3335e8923..d3e2d8b835d 100644 --- a/gcc/config/i386/sysv4.h +++ b/gcc/config/i386/sysv4.h @@ -34,12 +34,9 @@ Boston, MA 02111-1307, USA. */ /* Output at beginning of assembler file. */ /* The .file command should always begin the output. */ -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ - do { \ - output_file_directive (FILE, main_input_filename); \ - fprintf (FILE, "\t.version\t\"01.01\"\n"); \ - } while (0) +#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true +#undef X86_FILE_START_VERSION_DIRECTIVE +#define X86_FILE_START_VERSION_DIRECTIVE true #undef DBX_REGISTER_NUMBER #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n] |