summaryrefslogtreecommitdiff
path: root/gcc/config/cris
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-19 19:55:33 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-19 19:55:33 +0000
commit367b1459a0a977c75979523f7cb6b7c8925effd1 (patch)
treefca433b11c05a5a771c4a816fb110130e6e63fcb /gcc/config/cris
parent5278936147992d23260efa65de66fb7429c096b3 (diff)
downloadgcc-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/cris')
-rw-r--r--gcc/config/cris/cris-protos.h1
-rw-r--r--gcc/config/cris/cris.c20
-rw-r--r--gcc/config/cris/cris.h11
3 files changed, 26 insertions, 6 deletions
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"