diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-19 19:55:33 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-19 19:55:33 +0000 |
commit | 367b1459a0a977c75979523f7cb6b7c8925effd1 (patch) | |
tree | fca433b11c05a5a771c4a816fb110130e6e63fcb /gcc/config | |
parent | 5278936147992d23260efa65de66fb7429c096b3 (diff) | |
download | gcc-367b1459a0a977c75979523f7cb6b7c8925effd1.tar.gz |
gcc/
* target.def (output_ident): New hook.
* targhooks.h (default_asm_output_ident_directive): Add prototype.
* varasm.c (assemble_asm): Only prefix a tab if the string does not
already start with one.
(default_asm_output_ident_directive): New function to emit
.ident as a top-level asm node while parsing, or directly to
asm_out_file after parsing.
* toplev.c (compile_file): Print a GCC .ident with
targetm.asm_out.output_ident.
* doc/tm.texi.in (ASM_OUTPUT_IDENT): Remove documentation for macro.
(TARGET_ASM_OUTPUT_IDENT): Add @hook for this.
* doc/tm.texi: Update.
* config/elfos.h (ASM_OUTPUT_IDENT, IDENT_ASM_OP): Remove.
(TARGET_ASM_OUTPUT_IDENT): Define.
* config/i386/djgpp.h (IDENT_ASM_OP): Remove.
* config/i386/gas.h (ASM_OUTPUT_IDENT): Remove.
* config/arm/aout.h (ASM_OUTPUT_IDENT): Remove.
* config/sparc/sparc.h (IDENT_ASM_OP): Remove.
(TARGET_ASM_OUTPUT_IDENT): Define.
* config/picochip/picochip.h (IDENT_ASM_OP): Remove.
(TARGET_ASM_OUTPUT_IDENT): Define.
* config/cris/cris-protos.h (cris_asm_output_ident): Add prototype.
* config/cris/cris.c (cris_asm_output_ident): New function.
* config/cris/cris.h (ASM_OUTPUT_IDENT, IDENT_ASM_OP): Remove.
* config/microblaze/microblaze-protos.h (microblaze_asm_output_ident):
Add prototype.
* config/microblaze/microblaze.c: Include cgraph.h for add_asm_node.
(microblaze_asm_output_ident): Rewrite to work similar to
default_asm_output_ident_directive for front-end .idents.
* config/microblaze/microblaze.h (ASM_OUTPUT_IDENT): Remove.
(TARGET_ASM_OUTPUT_IDENT): Define.
* config/mips/mips.h (ASM_OUTPUT_IDENT): Remove.
* config/mips/sde.h (IDENT_ASM_OP, ASM_OUTPUT_IDENT): Remove.
* config/rx/rx.c: Include cgraph.h for add_asm_node.
(rx_asm_output_ident): New function, similar to
default_asm_output_ident_directive, but handle AS100 syntax also, so
that #ident also works for rx in AS100 syntax.
(TARGET_ASM_OUTPUT_IDENT): Define.
* config/rx/rx.h (IDENT_ASM_OP): Remove.
* Makefile.in: Fix dependencies for c-family/c-lex.o.
c-family/
* c-lex.c: Do not include output.h.
(cb_ident): Try to put out .ident with targetm.asm_out.output_ident.
Remove uses of ASM_OUTPUT_IDENT.
ada/
* gcc-interface/trans.c: Include target.h.
(gigi): Try to put out .ident with targetm.asm_out.output_ident.
Remove uses of ASM_OUTPUT_IDENT.
* gcc-interface/Make-lang.in: Fix dependencies.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188791 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/arm/aout.h | 6 | ||||
-rw-r--r-- | gcc/config/cris/cris-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/cris/cris.c | 20 | ||||
-rw-r--r-- | gcc/config/cris/cris.h | 11 | ||||
-rw-r--r-- | gcc/config/elfos.h | 6 | ||||
-rw-r--r-- | gcc/config/i386/djgpp.h | 4 | ||||
-rw-r--r-- | gcc/config/i386/gas.h | 3 | ||||
-rw-r--r-- | gcc/config/microblaze/microblaze-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/microblaze/microblaze.c | 25 | ||||
-rw-r--r-- | gcc/config/microblaze/microblaze.h | 4 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 9 | ||||
-rw-r--r-- | gcc/config/mips/sde.h | 11 | ||||
-rw-r--r-- | gcc/config/picochip/picochip.h | 3 | ||||
-rw-r--r-- | gcc/config/rx/rx.c | 1 | ||||
-rw-r--r-- | gcc/config/rx/rx.h | 4 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.h | 6 |
16 files changed, 57 insertions, 59 deletions
diff --git a/gcc/config/arm/aout.h b/gcc/config/arm/aout.h index f8e7367fd66..c60adb9a329 100644 --- a/gcc/config/arm/aout.h +++ b/gcc/config/arm/aout.h @@ -366,12 +366,6 @@ asm_output_aligned_bss (STREAM, DECL, NAME, SIZE, ALIGN) #endif -/* Output a #ident directive. */ -#ifndef ASM_OUTPUT_IDENT -#define ASM_OUTPUT_IDENT(STREAM,STRING) \ - asm_fprintf (STREAM, "%@ - - - ident %s\n", STRING) -#endif - #ifndef ASM_COMMENT_START #define ASM_COMMENT_START "@" #endif diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h index b8d1c78db6d..d08dac5dab0 100644 --- a/gcc/config/cris/cris-protos.h +++ b/gcc/config/cris/cris-protos.h @@ -52,6 +52,7 @@ extern void cris_order_for_addsi3 (rtx *, int); extern void cris_emit_trap_for_misalignment (rtx); #endif /* RTX_CODE */ extern void cris_asm_output_label_ref (FILE *, char *); +extern void cris_asm_output_ident (const char *); extern void cris_expand_prologue (void); extern void cris_expand_epilogue (void); extern void cris_expand_return (bool); diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index 3c6fb080ed3..a5a342720bb 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -2467,6 +2467,22 @@ cris_legitimate_pic_operand (rtx x) return cris_valid_pic_const (x, true); } +/* Queue an .ident string in the queue of top-level asm statements. + If the front-end is done, we must be being called from toplev.c. + In that case, do nothing. */ +void +cris_asm_output_ident (const char *string) +{ + const char *section_asm_op; + int size; + char *buf; + + if (cgraph_state != CGRAPH_STATE_PARSING) + return; + + default_asm_output_ident_directive (string); +} + /* The ASM_OUTPUT_CASE_END worker. */ void @@ -2517,6 +2533,10 @@ cris_asm_output_case_end (FILE *stream, int num, rtx table) static void cris_option_override (void) { + /* We don't want an .ident for gcc. + It isn't really clear anymore why not. */ + flag_no_gcc_ident = true; + if (cris_max_stackframe_str) { cris_max_stackframe = atoi (cris_max_stackframe_str); diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index 4e335314f3e..b0bc57f7c0f 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -842,12 +842,11 @@ enum cris_pic_symbol_type /* Node: File Framework */ /* We don't want an .ident for gcc. To avoid that but still support - #ident, we override ASM_OUTPUT_IDENT and, since the gcc .ident is its - only use besides ASM_OUTPUT_IDENT, undef IDENT_ASM_OP from elfos.h. */ -#undef IDENT_ASM_OP -#undef ASM_OUTPUT_IDENT -#define ASM_OUTPUT_IDENT(FILE, NAME) \ - fprintf (FILE, "%s\"%s\"\n", "\t.ident\t", NAME); + #ident, we override TARGET_ASM_OUTPUT_IDENT and, since the gcc .ident + is its only use besides front-end .ident directives, we return if + the state if the cgraph is not CGRAPH_STATE_PARSING. */ +#undef TARGET_ASM_OUTPUT_IDENT +#define TARGET_ASM_OUTPUT_IDENT cris_asm_output_ident #define ASM_APP_ON "#APP\n" diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h index dc68c810f26..4c748835da3 100644 --- a/gcc/config/elfos.h +++ b/gcc/config/elfos.h @@ -83,10 +83,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* Output #ident as a .ident. */ -#define ASM_OUTPUT_IDENT(FILE, NAME) \ - fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME); - -#define IDENT_ASM_OP "\t.ident\t" +#undef TARGET_ASM_OUTPUT_IDENT +#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive #undef SET_ASM_OP #define SET_ASM_OP "\t.set\t" diff --git a/gcc/config/i386/djgpp.h b/gcc/config/i386/djgpp.h index c770219657c..b2efb343545 100644 --- a/gcc/config/i386/djgpp.h +++ b/gcc/config/i386/djgpp.h @@ -31,10 +31,6 @@ along with GCC; see the file COPYING3. If not see #undef DATA_SECTION_ASM_OP #define DATA_SECTION_ASM_OP "\t.section .data" -/* Define the name of the .ident op. */ -#undef IDENT_ASM_OP -#define IDENT_ASM_OP "\t.ident\t" - /* Enable alias attribute support. */ #ifndef SET_ASM_OP #define SET_ASM_OP "\t.set\t" diff --git a/gcc/config/i386/gas.h b/gcc/config/i386/gas.h index 4c7c9d1ac62..bb5877ff4bb 100644 --- a/gcc/config/i386/gas.h +++ b/gcc/config/i386/gas.h @@ -47,7 +47,8 @@ along with GCC; see the file COPYING3. If not see /* Output #ident as a .ident. */ -#define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME); +#undef TARGET_ASM_OUTPUT_IDENT +#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive /* In the past there was confusion as to what the argument to .align was in GAS. For the last several years the rule has been this: for a.out diff --git a/gcc/config/microblaze/microblaze-protos.h b/gcc/config/microblaze/microblaze-protos.h index 0a7d1c7f56d..8673e49fb0c 100644 --- a/gcc/config/microblaze/microblaze-protos.h +++ b/gcc/config/microblaze/microblaze-protos.h @@ -48,7 +48,7 @@ extern int microblaze_regno_ok_for_base_p (int, int); extern HOST_WIDE_INT microblaze_initial_elimination_offset (int, int); extern void microblaze_declare_object (FILE *, const char *, const char *, const char *, int); -extern void microblaze_asm_output_ident (FILE *, const char *); +extern void microblaze_asm_output_ident (const char *); #endif /* RTX_CODE */ /* Declare functions in microblaze-c.c. */ diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c index 8d08bc282ff..31248a0b559 100644 --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -47,6 +47,7 @@ #include "df.h" #include "optabs.h" #include "diagnostic-core.h" +#include "cgraph.h" #define MICROBLAZE_VERSION_COMPARE(VA,VB) strcasecmp (VA, VB) @@ -2736,16 +2737,28 @@ microblaze_return_addr (int count, rtx frame ATTRIBUTE_UNUSED) GEN_INT (8)); } -/* Put string into .sdata2 if below threashold. */ +/* Queue an .ident string in the queue of top-level asm statements. + If the string size is below the threshold, put it into .sdata2. + If the front-end is done, we must be being called from toplev.c. + In that case, do nothing. */ void -microblaze_asm_output_ident (FILE *file ATTRIBUTE_UNUSED, const char *string) +microblaze_asm_output_ident (const char *string) { - int size = strlen (string) + 1; + const char *section_asm_op; + int size; + char *buf; + + if (cgraph_state != CGRAPH_STATE_PARSING) + return; + + size = strlen (string) + 1; if (size <= microblaze_section_threshold) - switch_to_section (sdata2_section); + section_asm_op = SDATA2_SECTION_ASM_OP; else - switch_to_section (readonly_data_section); - assemble_string (string, size); + section_asm_op = READONLY_DATA_SECTION_ASM_OP; + + buf = ACONCAT ((section_asm_op, "\n\t.ascii \"", string, "\\0\"\n", NULL)); + add_asm_node (build_string (strlen (buf), buf)); } static void diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h index d17d8948335..783d1e09cb1 100644 --- a/gcc/config/microblaze/microblaze.h +++ b/gcc/config/microblaze/microblaze.h @@ -696,8 +696,8 @@ do { \ #define ASCII_DATA_ASM_OP "\t.ascii\t" #define STRING_ASM_OP "\t.asciz\t" -#define ASM_OUTPUT_IDENT(FILE, STRING) \ - microblaze_asm_output_ident (FILE, STRING) +#undef TARGET_ASM_OUTPUT_IDENT +#define TARGET_ASM_OUTPUT_IDENT microblaze_asm_output_ident /* Default to -G 8 */ #ifndef MICROBLAZE_DEFAULT_GVALUE diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index bcb7c0436d0..97f38b2c49b 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -2674,15 +2674,6 @@ do { \ #undef ASM_OUTPUT_ASCII #define ASM_OUTPUT_ASCII mips_output_ascii -/* Output #ident as a in the read-only data section. */ -#undef ASM_OUTPUT_IDENT -#define ASM_OUTPUT_IDENT(FILE, STRING) \ -{ \ - const char *p = STRING; \ - int size = strlen (p) + 1; \ - switch_to_section (readonly_data_section); \ - assemble_string (p, size); \ -} /* Default to -G 8 */ #ifndef MIPS_DEFAULT_GVALUE diff --git a/gcc/config/mips/sde.h b/gcc/config/mips/sde.h index cc420eb5c53..0fada904e8a 100644 --- a/gcc/config/mips/sde.h +++ b/gcc/config/mips/sde.h @@ -97,17 +97,6 @@ along with GCC; see the file COPYING3. If not see /* Use periods rather than dollar signs in special g++ assembler names. */ #define NO_DOLLAR_IN_LABEL -/* Attach a special .ident directive to the end of the file to identify - the version of GCC which compiled this code. */ -#undef IDENT_ASM_OP -#define IDENT_ASM_OP "\t.ident\t" - -/* Output #ident string into the ELF .comment section, so it doesn't - form part of the load image, and so that it can be stripped. */ -#undef ASM_OUTPUT_IDENT -#define ASM_OUTPUT_IDENT(STREAM, STRING) \ - fprintf (STREAM, "%s\"%s\"\n", IDENT_ASM_OP, STRING); - /* Currently we don't support 128bit long doubles, so for now we force n32 to be 64bit. */ #undef LONG_DOUBLE_TYPE_SIZE diff --git a/gcc/config/picochip/picochip.h b/gcc/config/picochip/picochip.h index 9eb7df94c01..f13efc9c4a6 100644 --- a/gcc/config/picochip/picochip.h +++ b/gcc/config/picochip/picochip.h @@ -488,7 +488,8 @@ do { \ #define ASM_APP_ON "// High-level ASM start\n" #define ASM_APP_OFF "// High-level ASM end\n" -#define ASM_OUTPUT_IDENT(STREAM,STRING) fprintf(STREAM, ".ident %s\n", STRING) +#undef TARGET_ASM_OUTPUT_IDENT +#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive /* Output of Data */ diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c index 016c34827ce..08b998e2a46 100644 --- a/gcc/config/rx/rx.c +++ b/gcc/config/rx/rx.c @@ -52,6 +52,7 @@ #include "target-def.h" #include "langhooks.h" #include "opts.h" +#include "cgraph.h" static unsigned int rx_gp_base_regnum_val = INVALID_REGNUM; static unsigned int rx_pid_base_regnum_val = INVALID_REGNUM; diff --git a/gcc/config/rx/rx.h b/gcc/config/rx/rx.h index 80c5b498f05..065079fbbbd 100644 --- a/gcc/config/rx/rx.h +++ b/gcc/config/rx/rx.h @@ -602,10 +602,6 @@ typedef unsigned int CUMULATIVE_ARGS; } \ while (0) -#undef IDENT_ASM_OP -#define IDENT_ASM_OP (TARGET_AS100_SYNTAX \ - ? "\t.END\t; Built by: ": "\t.ident\t") - /* For PIC put jump tables into the text section so that the offsets that they contain are always computed between two same-section symbols. */ #define JUMP_TABLES_IN_TEXT_SECTION (TARGET_PID || flag_pic) diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 234edcfd9c4..81bcce8b663 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -1709,12 +1709,10 @@ do { \ ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \ } while (0) -#define IDENT_ASM_OP "\t.ident\t" - /* Output #ident as a .ident. */ -#define ASM_OUTPUT_IDENT(FILE, NAME) \ - fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME); +#undef TARGET_ASM_OUTPUT_IDENT +#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive /* Prettify the assembly. */ |