Commit e4f7c483 by Anatoly Sokolov Committed by Anatoly Sokolov

* target.h (struct asm_out):Add declare_constant_name field.

	* target-def.h (TARGET_ASM_DECLARE_CONSTANT_NAME): Define.
	(TARGET_INITIALIZER): Use TARGET_ASM_DECLARE_CONSTANT_NAME.
	* output.h (default_asm_declare_constant_name): Declare.
	(assemble_label): Update prototype.
	* varasm.c (assemble_constant_contents): Use
	targetm.asm_out.declare_constant_name target hook.
	(assemble_label): Add 'file' argument.
	(default_asm_declare_constant_name): New function.
	* system.h (ASM_DECLARE_CONSTANT_NAME): Poison.
	* doc/tm.texi (ASM_DECLARE_CONSTANT_NAME): Remove.
	(TARGET_ASM_DECLARE_CONSTANT_NAME): Document it.

	* config/darwin-protos.h (darwin_asm_declare_constant_name): Declare.
	* config/darwin.c (darwin_asm_declare_constant_name): New function.
	(machopic_output_indirection): Update assemble_label argument list.
	* config/darwin.h (ASM_DECLARE_CONSTANT_NAME): Remove.
	(TARGET_ASM_DECLARE_CONSTANT_NAME): Define.

From-SVN: r160811
parent d1a115f8
2010-06-15 Anatoly Sokolov <aesok@post.ru>
* target.h (struct asm_out):Add declare_constant_name field.
* target-def.h (TARGET_ASM_DECLARE_CONSTANT_NAME): Define.
(TARGET_INITIALIZER): Use TARGET_ASM_DECLARE_CONSTANT_NAME.
* output.h (default_asm_declare_constant_name): Declare.
(assemble_label): Update prototype.
* varasm.c (assemble_constant_contents): Use
targetm.asm_out.declare_constant_name target hook.
(assemble_label): Add 'file' argument.
(default_asm_declare_constant_name): New function.
* system.h (ASM_DECLARE_CONSTANT_NAME): Poison.
* doc/tm.texi (ASM_DECLARE_CONSTANT_NAME): Remove.
(TARGET_ASM_DECLARE_CONSTANT_NAME): Document it.
* config/darwin-protos.h (darwin_asm_declare_constant_name): Declare.
* config/darwin.c (darwin_asm_declare_constant_name): New function.
(machopic_output_indirection): Update assemble_label argument list.
* config/darwin.h (ASM_DECLARE_CONSTANT_NAME): Remove.
(TARGET_ASM_DECLARE_CONSTANT_NAME): Define.
2010-06-15 Sebastian Pop <sebastian.pop@amd.com> 2010-06-15 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/44391 PR middle-end/44391
......
...@@ -87,6 +87,8 @@ extern void darwin_asm_output_dwarf_delta (FILE *, int, const char *, ...@@ -87,6 +87,8 @@ extern void darwin_asm_output_dwarf_delta (FILE *, int, const char *,
const char *); const char *);
extern void darwin_asm_output_dwarf_offset (FILE *, int, const char *, extern void darwin_asm_output_dwarf_offset (FILE *, int, const char *,
section *); section *);
extern void darwin_asm_declare_constant_name (FILE *, const char *,
const_tree, HOST_WIDE_INT);
extern bool darwin_binds_local_p (const_tree); extern bool darwin_binds_local_p (const_tree);
extern void darwin_cpp_builtins (struct cpp_reader *); extern void darwin_cpp_builtins (struct cpp_reader *);
extern void darwin_asm_output_anchor (rtx symbol); extern void darwin_asm_output_anchor (rtx symbol);
......
...@@ -966,7 +966,7 @@ machopic_output_indirection (void **slot, void *data) ...@@ -966,7 +966,7 @@ machopic_output_indirection (void **slot, void *data)
{ {
switch_to_section (data_section); switch_to_section (data_section);
assemble_align (GET_MODE_ALIGNMENT (Pmode)); assemble_align (GET_MODE_ALIGNMENT (Pmode));
assemble_label (ptr_name); assemble_label (asm_out_file, ptr_name);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, sym_name), assemble_integer (gen_rtx_SYMBOL_REF (Pmode, sym_name),
GET_MODE_SIZE (Pmode), GET_MODE_SIZE (Pmode),
GET_MODE_ALIGNMENT (Pmode), 1); GET_MODE_ALIGNMENT (Pmode), 1);
...@@ -1617,6 +1617,20 @@ darwin_non_lazy_pcrel (FILE *file, rtx addr) ...@@ -1617,6 +1617,20 @@ darwin_non_lazy_pcrel (FILE *file, rtx addr)
fputs ("-.", file); fputs ("-.", file);
} }
/* The implementation of ASM_DECLARE_CONSTANT_NAME. */
void
darwin_asm_declare_constant_name (FILE *file, const char *name,
const_tree exp ATTRIBUTE_UNUSED,
HOST_WIDE_INT size)
{
assemble_label (file, name);
/* Darwin doesn't support zero-size objects, so give them a byte. */
if ((size) == 0)
assemble_zeros (1);
}
/* Emit an assembler directive to set visibility for a symbol. The /* Emit an assembler directive to set visibility for a symbol. The
only supported visibilities are VISIBILITY_DEFAULT and only supported visibilities are VISIBILITY_DEFAULT and
VISIBILITY_HIDDEN; the latter corresponds to Darwin's "private VISIBILITY_HIDDEN; the latter corresponds to Darwin's "private
......
...@@ -652,14 +652,8 @@ extern GTY(()) int darwin_ms_struct; ...@@ -652,14 +652,8 @@ extern GTY(()) int darwin_ms_struct;
ASM_OUTPUT_LABEL (FILE, xname); \ ASM_OUTPUT_LABEL (FILE, xname); \
} while (0) } while (0)
#define ASM_DECLARE_CONSTANT_NAME(FILE, NAME, EXP, SIZE) \ #undef TARGET_ASM_DECLARE_CONSTANT_NAME
do { \ #define TARGET_ASM_DECLARE_CONSTANT_NAME darwin_asm_declare_constant_name
ASM_OUTPUT_LABEL (FILE, NAME); \
/* Darwin doesn't support zero-size objects, so give them a \
byte. */ \
if ((SIZE) == 0) \
assemble_zeros (1); \
} while (0)
/* Wrap new method names in quotes so the assembler doesn't gag. /* Wrap new method names in quotes so the assembler doesn't gag.
Make Objective-C internal symbols local and in doing this, we need Make Objective-C internal symbols local and in doing this, we need
......
...@@ -7787,21 +7787,19 @@ You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} and/or ...@@ -7787,21 +7787,19 @@ You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} and/or
@code{ASM_OUTPUT_SIZE_DIRECTIVE} in the definition of this macro. @code{ASM_OUTPUT_SIZE_DIRECTIVE} in the definition of this macro.
@end defmac @end defmac
@defmac ASM_DECLARE_CONSTANT_NAME (@var{stream}, @var{name}, @var{exp}, @var{size}) @deftypefn {Target Hook} void TARGET_ASM_DECLARE_CONSTANT_NAME (FILE * @var{file}, const char * @var{name}, const_tree @var{expr}, HOST_WIDE_INT @var{size})
A C statement (sans semicolon) to output to the stdio stream A target hook to output to the stdio stream @var{file} any text necessary
@var{stream} any text necessary for declaring the name @var{name} of a for declaring the name @var{name} of a constant which is being defined. This
constant which is being defined. This macro is responsible for target hook is responsible for outputting the label definition (perhaps using
outputting the label definition (perhaps using @code{assemble_label}). The argument @var{exp} is the value of the constant,
@code{ASM_OUTPUT_LABEL}). The argument @var{exp} is the and @var{size} is the size of the constant in bytes. The @var{name}
value of the constant, and @var{size} is the size of the constant will be an internal label.
in bytes. @var{name} will be an internal label.
If this macro is not defined, then the @var{name} is defined in the The default version of this target hook, define the @var{name} in the
usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}). usual manner as a label (by means of @code{assemble_label}).
You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in the definition You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in this target hook.
of this macro. @end deftypefn
@end defmac
@defmac ASM_DECLARE_REGISTER_GLOBAL (@var{stream}, @var{decl}, @var{regno}, @var{name}) @defmac ASM_DECLARE_REGISTER_GLOBAL (@var{stream}, @var{decl}, @var{regno}, @var{name})
A C statement (sans semicolon) to output to the stdio stream A C statement (sans semicolon) to output to the stdio stream
......
/* Declarations for insn-output.c. These functions are defined in recog.c, /* Declarations for insn-output.c. These functions are defined in recog.c,
final.c, and varasm.c. final.c, and varasm.c.
Copyright (C) 1987, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002, Copyright (C) 1987, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -230,7 +231,7 @@ extern void assemble_string (const char *, int); ...@@ -230,7 +231,7 @@ extern void assemble_string (const char *, int);
extern void assemble_external_libcall (rtx); extern void assemble_external_libcall (rtx);
/* Assemble a label named NAME. */ /* Assemble a label named NAME. */
extern void assemble_label (const char *); extern void assemble_label (FILE *, const char *);
/* Output to FILE (an assembly file) a reference to NAME. If NAME /* Output to FILE (an assembly file) a reference to NAME. If NAME
starts with a *, the rest of NAME is output verbatim. Otherwise starts with a *, the rest of NAME is output verbatim. Otherwise
...@@ -630,6 +631,8 @@ extern void default_globalize_decl_name (FILE *, tree); ...@@ -630,6 +631,8 @@ extern void default_globalize_decl_name (FILE *, tree);
extern void default_emit_unwind_label (FILE *, tree, int, int); extern void default_emit_unwind_label (FILE *, tree, int, int);
extern void default_emit_except_table_label (FILE *); extern void default_emit_except_table_label (FILE *);
extern void default_internal_label (FILE *, const char *, unsigned long); extern void default_internal_label (FILE *, const char *, unsigned long);
extern void default_asm_declare_constant_name (FILE *, const char *,
const_tree, HOST_WIDE_INT);
extern void default_file_start (void); extern void default_file_start (void);
extern void file_end_indicate_exec_stack (void); extern void file_end_indicate_exec_stack (void);
......
...@@ -768,7 +768,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; ...@@ -768,7 +768,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
SMALL_ARG_MAX ASM_OUTPUT_SHARED_BSS ASM_OUTPUT_SHARED_COMMON \ SMALL_ARG_MAX ASM_OUTPUT_SHARED_BSS ASM_OUTPUT_SHARED_COMMON \
ASM_OUTPUT_SHARED_LOCAL ASM_MAKE_LABEL_LINKONCE \ ASM_OUTPUT_SHARED_LOCAL ASM_MAKE_LABEL_LINKONCE \
STACK_CHECK_PROBE_INTERVAL STACK_CHECK_PROBE_LOAD \ STACK_CHECK_PROBE_INTERVAL STACK_CHECK_PROBE_LOAD \
ORDER_REGS_FOR_LOCAL_ALLOC FUNCTION_OUTGOING_VALUE ORDER_REGS_FOR_LOCAL_ALLOC FUNCTION_OUTGOING_VALUE \
ASM_DECLARE_CONSTANT_NAME
/* Hooks that are no longer used. */ /* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
......
...@@ -84,6 +84,10 @@ ...@@ -84,6 +84,10 @@
#define TARGET_ASM_INTERNAL_LABEL default_internal_label #define TARGET_ASM_INTERNAL_LABEL default_internal_label
#endif #endif
#ifndef TARGET_ASM_DECLARE_CONSTANT_NAME
#define TARGET_ASM_DECLARE_CONSTANT_NAME default_asm_declare_constant_name
#endif
#ifndef TARGET_ASM_TTYPE #ifndef TARGET_ASM_TTYPE
#define TARGET_ASM_TTYPE hook_bool_rtx_false #define TARGET_ASM_TTYPE hook_bool_rtx_false
#endif #endif
...@@ -297,6 +301,7 @@ ...@@ -297,6 +301,7 @@
TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL, \ TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL, \
TARGET_UNWIND_EMIT, \ TARGET_UNWIND_EMIT, \
TARGET_ASM_INTERNAL_LABEL, \ TARGET_ASM_INTERNAL_LABEL, \
TARGET_ASM_DECLARE_CONSTANT_NAME, \
TARGET_ASM_TTYPE, \ TARGET_ASM_TTYPE, \
TARGET_ASM_ASSEMBLE_VISIBILITY, \ TARGET_ASM_ASSEMBLE_VISIBILITY, \
TARGET_ASM_FUNCTION_PROLOGUE, \ TARGET_ASM_FUNCTION_PROLOGUE, \
......
...@@ -171,6 +171,10 @@ struct gcc_target ...@@ -171,6 +171,10 @@ struct gcc_target
/* Output an internal label. */ /* Output an internal label. */
void (* internal_label) (FILE *, const char *, unsigned long); void (* internal_label) (FILE *, const char *, unsigned long);
/* Output label for the constant. */
void (* declare_constant_name) (FILE *, const char *, const_tree,
HOST_WIDE_INT);
/* Emit a ttype table reference to a typeinfo object. */ /* Emit a ttype table reference to a typeinfo object. */
bool (* ttype) (rtx); bool (* ttype) (rtx);
......
...@@ -2461,9 +2461,9 @@ assemble_external_libcall (rtx fun) ...@@ -2461,9 +2461,9 @@ assemble_external_libcall (rtx fun)
/* Assemble a label named NAME. */ /* Assemble a label named NAME. */
void void
assemble_label (const char *name) assemble_label (FILE *file, const char *name)
{ {
ASM_OUTPUT_LABEL (asm_out_file, name); ASM_OUTPUT_LABEL (file, name);
} }
/* Set the symbol_referenced flag for ID. */ /* Set the symbol_referenced flag for ID. */
...@@ -3475,12 +3475,7 @@ assemble_constant_contents (tree exp, const char *label, unsigned int align) ...@@ -3475,12 +3475,7 @@ assemble_constant_contents (tree exp, const char *label, unsigned int align)
size = get_constant_size (exp); size = get_constant_size (exp);
/* Do any machine/system dependent processing of the constant. */ /* Do any machine/system dependent processing of the constant. */
#ifdef ASM_DECLARE_CONSTANT_NAME targetm.asm_out.declare_constant_name (asm_out_file, label, exp, size);
ASM_DECLARE_CONSTANT_NAME (asm_out_file, label, exp, size);
#else
/* Standard thing is just output label for the constant. */
ASM_OUTPUT_LABEL (asm_out_file, label);
#endif /* ASM_DECLARE_CONSTANT_NAME */
/* Output the value of EXP. */ /* Output the value of EXP. */
output_constant (exp, size, align); output_constant (exp, size, align);
...@@ -6894,6 +6889,17 @@ default_internal_label (FILE *stream, const char *prefix, ...@@ -6894,6 +6889,17 @@ default_internal_label (FILE *stream, const char *prefix,
ASM_OUTPUT_INTERNAL_LABEL (stream, buf); ASM_OUTPUT_INTERNAL_LABEL (stream, buf);
} }
/* The default implementation of ASM_DECLARE_CONSTANT_NAME. */
void
default_asm_declare_constant_name (FILE *file, const char *name,
const_tree exp ATTRIBUTE_UNUSED,
HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
assemble_label (file, name);
}
/* This is the default behavior at the beginning of a file. It's /* This is the default behavior at the beginning of a file. It's
controlled by two other target-hook toggles. */ controlled by two other target-hook toggles. */
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment