OSDN Git Service

* configure.in: Delete three unused variables. Move a variable
[pf3gnuchains/gcc-fork.git] / gcc / dwarf2asm.c
index 2222ecd..396c2cd 100644 (file)
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "flags.h"
 #include "tree.h"
 #include "rtl.h"
@@ -60,7 +62,7 @@ dw2_assemble_integer (size, x)
   else
     assemble_integer (x, size, BITS_PER_UNIT, 1);
 }
-     
+
 
 /* Output an immediate constant in a given size.  */
 
@@ -104,11 +106,14 @@ dw2_asm_output_delta VPARAMS ((int size, const char *lab1, const char *lab2,
   VA_FIXEDARG (ap, const char *, lab2);
   VA_FIXEDARG (ap, const char *, comment);
 
+#ifdef ASM_OUTPUT_DWARF_DELTA
+  ASM_OUTPUT_DWARF_DELTA (asm_out_file, size, lab1, lab2);
+#else
   dw2_assemble_integer (size,
                        gen_rtx_MINUS (Pmode,
                                       gen_rtx_SYMBOL_REF (Pmode, lab1),
                                       gen_rtx_SYMBOL_REF (Pmode, lab2)));
-
+#endif
   if (flag_debug_asm && comment)
     {
       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
@@ -282,11 +287,10 @@ int
 size_of_uleb128 (value)
      unsigned HOST_WIDE_INT value;
 {
-  int size = 0, byte;
+  int size = 0;
 
   do
     {
-      byte = (value & 0x7f);
       value >>= 7;
       size += 1;
     }
@@ -316,7 +320,7 @@ size_of_sleb128 (value)
 }
 
 /* Given an encoding, return the number of bytes the format occupies.
-   This is only defined for fixed-size encodings, and so does not 
+   This is only defined for fixed-size encodings, and so does not
    include leb128.  */
 
 int
@@ -561,7 +565,7 @@ dw2_asm_output_data_uleb128 VPARAMS ((unsigned HOST_WIDE_INT value,
   VA_CLOSE (ap);
 }
 
-/* Output an signed LEB128 quantity.  */
+/* Output a signed LEB128 quantity.  */
 
 void
 dw2_asm_output_data_sleb128 VPARAMS ((HOST_WIDE_INT value,
@@ -684,12 +688,12 @@ dw2_asm_output_delta_sleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED,
   VA_CLOSE (ap);
 }
 \f
-static int mark_indirect_pool_entry PARAMS ((splay_tree_node, void *));
-static void mark_indirect_pool PARAMS ((PTR arg));
 static rtx dw2_force_const_mem PARAMS ((rtx));
 static int dw2_output_indirect_constant_1 PARAMS ((splay_tree_node, void *));
 
-static splay_tree indirect_pool;
+static GTY((param1_is (char *), param2_is (tree))) splay_tree indirect_pool;
+
+static GTY(()) int dw2_const_labelno;
 
 #if defined(HAVE_GAS_HIDDEN) && defined(SUPPORTS_ONE_ONLY)
 # define USE_LINKONCE_INDIRECT 1
@@ -697,26 +701,6 @@ static splay_tree indirect_pool;
 # define USE_LINKONCE_INDIRECT 0
 #endif
 
-/* Mark all indirect constants for GC.  */
-
-static int
-mark_indirect_pool_entry (node, data)
-     splay_tree_node node;
-     void* data ATTRIBUTE_UNUSED;
-{
-  ggc_mark_nonnull_tree ((tree) node->value);
-  return 0;
-}
-
-/* Mark all indirect constants for GC.  */
-
-static void
-mark_indirect_pool (arg)
-     PTR arg ATTRIBUTE_UNUSED;
-{
-  splay_tree_foreach (indirect_pool, mark_indirect_pool_entry, NULL);
-}
-
 /* Put X, a SYMBOL_REF, in memory.  Return a SYMBOL_REF to the allocated
    memory.  Differs from force_const_mem in that a single pool is used for
    the entire unit of translation, and the memory is not guaranteed to be
@@ -731,15 +715,12 @@ dw2_force_const_mem (x)
   tree decl;
 
   if (! indirect_pool)
-    {
-      indirect_pool = splay_tree_new (splay_tree_compare_pointers, NULL, NULL);
-      ggc_add_root (&indirect_pool, 1, sizeof indirect_pool, mark_indirect_pool);
-    }
+    indirect_pool = splay_tree_new_ggc (splay_tree_compare_pointers);
 
   if (GET_CODE (x) != SYMBOL_REF)
     abort ();
 
-  STRIP_NAME_ENCODING (str, XSTR (x, 0));
+  str = (* targetm.strip_name_encoding) (XSTR (x, 0));
   node = splay_tree_lookup (indirect_pool, (splay_tree_key) str);
   if (node)
     decl = (tree) node->value;
@@ -761,11 +742,10 @@ dw2_force_const_mem (x)
        }
       else
        {
-         extern int const_labelno;
          char label[32];
 
-         ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno);
-         ++const_labelno;
+         ASM_GENERATE_INTERNAL_LABEL (label, "LDFCM", dw2_const_labelno);
+         ++dw2_const_labelno;
          id = get_identifier (label);
          decl = build_decl (VAR_DECL, id, ptr_type_node);
          DECL_ARTIFICIAL (decl) = 1;
@@ -845,7 +825,7 @@ dw2_asm_output_encoded_addr_rtx VPARAMS ((int encoding,
     {
     restart:
       /* Allow the target first crack at emitting this.  Some of the
-        special relocations require special directives instead of 
+        special relocations require special directives instead of
         just ".4byte" or whatever.  */
 #ifdef ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
       ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX (asm_out_file, encoding, size,
@@ -883,7 +863,7 @@ dw2_asm_output_encoded_addr_rtx VPARAMS ((int encoding,
          break;
 
        default:
-         /* Other encodings should have been handled by 
+         /* Other encodings should have been handled by
             ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX.  */
          abort ();
        }
@@ -902,3 +882,5 @@ dw2_asm_output_encoded_addr_rtx VPARAMS ((int encoding,
 
   VA_CLOSE (ap);
 }
+
+#include "gt-dwarf2asm.h"