summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/darwin.c4
-rw-r--r--gcc/defaults.h9
-rw-r--r--gcc/doc/tm.texi8
-rw-r--r--gcc/output.h15
-rw-r--r--gcc/system.h2
-rw-r--r--gcc/varasm.c30
7 files changed, 61 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cf2c8f5aac6..b77cbbf8fc9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2004-12-19 Mark Mitchell <mark@codesourcery.com>
+
+ * defaults.h (ASM_OUTPUT_INTERNAL_LABEL): New macro.
+ * output.h (assemble_name_raw): Declare it.
+ * system.h (ASM_OUTPUT_INTERNAL_LABEL): Do not poison it.
+ * varasm.c (assemble_name_raw): New function.
+ (assemble_name): Use it.
+ (default_internal_label): Likewise.
+ * config/darwin.c (darwin_asm_output_dwarf_delta): Likewise.
+ * doc/tm.texi (ASM_OUTPUT_INTERNAL_LABEL): Document.
+
2004-12-19 Richard Henderson <rth@redhat.com>
PR 18067
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 7b4943b5a15..ad3981e9200 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1367,9 +1367,9 @@ darwin_asm_output_dwarf_delta (FILE *file, int size ATTRIBUTE_UNUSED,
fprintf (file, "\t.set L$set$%d,", darwin_dwarf_label_counter);
else
fprintf (file, "\t%s\t", ".long");
- assemble_name (file, lab1);
+ assemble_name_raw (file, lab1);
fprintf (file, "-");
- assemble_name (file, lab2);
+ assemble_name_raw (file, lab2);
if (islocaldiff)
fprintf (file, "\n\t.long L$set$%d", darwin_dwarf_label_counter++);
}
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 1c95c6a19cd..236ed90dee0 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -145,6 +145,15 @@ do { fputs (integer_asm_op (POINTER_SIZE / BITS_PER_UNIT, TRUE), FILE); \
do { assemble_name ((FILE), (NAME)); fputs (":\n", (FILE)); } while (0)
#endif
+/* Output the definition of a compiler-generated label named NAME. */
+#ifndef ASM_OUTPUT_INTERNAL_LABEL
+#define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \
+ do { \
+ assemble_name_raw ((FILE), (NAME)); \
+ fputs (":\n", (FILE)); \
+ } while (0)
+#endif
+
/* This is how to output a reference to a user-level label named NAME. */
#ifndef ASM_OUTPUT_LABELREF
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index f5436d7c78f..e33844237b4 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -6669,6 +6669,14 @@ assembler syntax for defining the name, and a newline. A default
definition of this macro is provided which is correct for most systems.
@end defmac
+@findex assemble_name_raw
+@defmac ASM_OUTPUT_INTERNAL_LABEL (@var{stream}, @var{name})
+Identical to @code{ASM_OUTPUT_lABEL}, except that @var{name} is known
+to refer to a compiler-generated label. The default definition uses
+@code{assemble_name_raw}, which is like @code{assemble_name} except
+that it is more efficient.
+@end defmac
+
@defmac SIZE_ASM_OP
A C string containing the appropriate assembler directive to specify the
size of a symbol, without any arguments. On systems that use ELF, the
diff --git a/gcc/output.h b/gcc/output.h
index 95090064079..b014b2321f4 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -291,11 +291,16 @@ extern void assemble_external_libcall (rtx);
/* Assemble a label named NAME. */
extern void assemble_label (const char *);
-/* Output to FILE a reference to the assembler name of a C-level name NAME.
- If NAME starts with a *, the rest of NAME is output verbatim.
- Otherwise NAME is transformed in an implementation-defined way
- (usually by the addition of an underscore).
- Many macros in the tm file are defined to call this function. */
+/* Output to FILE (an assembly file) a reference to NAME. If NAME
+ starts with a *, the rest of NAME is output verbatim. Otherwise
+ NAME is transformed in a target-specific way (usually by the
+ addition of an underscore). */
+extern void assemble_name_raw (FILE *, const char *);
+
+/* Like assemble_name_raw, but should be used when NAME might refer to
+ an entity that is also represented as a tree (like a function or
+ variable). If NAME does refer to such an entity, that entity will
+ be marked as referenced. */
extern void assemble_name (FILE *, const char *);
/* Return the assembler directive for creating a given kind of integer
diff --git a/gcc/system.h b/gcc/system.h
index fb6b4850929..e5ed12212ef 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -631,7 +631,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
BLOCK_PROFILER BLOCK_PROFILER_CODE FUNCTION_BLOCK_PROFILER \
FUNCTION_BLOCK_PROFILER_EXIT MACHINE_STATE_SAVE \
MACHINE_STATE_RESTORE SCCS_DIRECTIVE SECTION_ASM_OP \
- ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL ASM_OUTPUT_INTERNAL_LABEL \
+ ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL \
OBJC_PROLOGUE ALLOCATE_TRAMPOLINE HANDLE_PRAGMA ROUND_TYPE_SIZE \
ROUND_TYPE_SIZE_UNIT CONST_SECTION_ASM_OP CRT_GET_RFIB_TEXT \
DBX_LBRAC_FIRST DBX_OUTPUT_ENUM DBX_OUTPUT_SOURCE_FILENAME \
diff --git a/gcc/varasm.c b/gcc/varasm.c
index e6d018c9125..79503d194d1 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1889,11 +1889,24 @@ mark_decl_referenced (tree decl)
which do not need to be marked. */
}
-/* Output to FILE a reference to the assembler name of a C-level name NAME.
- If NAME starts with a *, the rest of NAME is output verbatim.
- Otherwise NAME is transformed in an implementation-defined way
- (usually by the addition of an underscore).
- Many macros in the tm file are defined to call this function. */
+/* Output to FILE (an assembly file) a reference to NAME. If NAME
+ starts with a *, the rest of NAME is output verbatim. Otherwise
+ NAME is transformed in a target-specific way (usually by the
+ addition of an underscore). */
+
+void
+assemble_name_raw (FILE *file, const char *name)
+{
+ if (name[0] == '*')
+ fputs (&name[1], file);
+ else
+ ASM_OUTPUT_LABELREF (file, name);
+}
+
+/* Like assemble_name_raw, but should be used when NAME might refer to
+ an entity that is also represented as a tree (like a function or
+ variable). If NAME does refer to such an entity, that entity will
+ be marked as referenced. */
void
assemble_name (FILE *file, const char *name)
@@ -1907,10 +1920,7 @@ assemble_name (FILE *file, const char *name)
if (id)
mark_referenced (id);
- if (name[0] == '*')
- fputs (&name[1], file);
- else
- ASM_OUTPUT_LABELREF (file, name);
+ assemble_name_raw (file, name);
}
/* Allocate SIZE bytes writable static space with a gensym name
@@ -5204,7 +5214,7 @@ default_internal_label (FILE *stream, const char *prefix,
{
char *const buf = alloca (40 + strlen (prefix));
ASM_GENERATE_INTERNAL_LABEL (buf, prefix, labelno);
- ASM_OUTPUT_LABEL (stream, buf);
+ ASM_OUTPUT_INTERNAL_LABEL (stream, buf);
}
/* This is the default behavior at the beginning of a file. It's