defaults.h (ASM_OUTPUT_INTERNAL_LABEL): New macro.
authorMark Mitchell <mark@codesourcery.com>
Mon, 20 Dec 2004 02:08:57 +0000 (02:08 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 20 Dec 2004 02:08:57 +0000 (02:08 +0000)
* 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.

From-SVN: r92401

gcc/ChangeLog
gcc/config/darwin.c
gcc/defaults.h
gcc/doc/tm.texi
gcc/output.h
gcc/system.h
gcc/varasm.c

index cf2c8f5aac66d418773621b3146b03c607293237..b77cbbf8fc9d4f7101d25833ad87e6f10c32680c 100644 (file)
@@ -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
index 7b4943b5a159962a178fd3d8ae88d4d6db5c75d3..ad3981e920022a378a07b3282a658057f1723d96 100644 (file)
@@ -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++);
 }
index 1c95c6a19cdeeef20a677310907ed14819682cfb..236ed90dee0184248843c58a485bb50888c8f5e9 100644 (file)
@@ -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
index f5436d7c78fb6eafa76d6a86c5336d1630e32bba..e33844237b4535c9e1f6b7dc36082e49ecb83061 100644 (file)
@@ -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
index 95090064079f4b35a59fb7d9994dea4da7d8f2ea..b014b2321f484ee5450986fa5bb31b3bbf2489bf 100644 (file)
@@ -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
index fb6b485092986a76998aff53327f97046871dfcd..e5ed12212efc2e243787d4c2e740e4635b8077e0 100644 (file)
@@ -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         \
index e6d018c9125b51af1633ff8cc1e046bb63dabc81..79503d194d183ec97ded4cdcaebf61e7e50a28b1 100644 (file)
@@ -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