public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* HACK : getting dwarf2asm.c to compile in CVS head
@ 2003-02-01  2:22 James Michael DuPont
  0 siblings, 0 replies; only message in thread
From: James Michael DuPont @ 2003-02-01  2:22 UTC (permalink / raw)
  To: gcc

Dear all,
I have had problems with compiling CVS head.
It seems that gengtype does not like dwarfs,
or should i say splay_trees.

I added this ifdef to trick it to think that it knows about splay
trees,

+#ifndef IN_GCC
+struct splay_tree_node_s;
+typedef struct splay_tree_s  *splay_tree;
+typedef struct splay_tree_node_s *splay_tree_node;
+#endif 

and gutted the functions in this file to get it to compile.
So now i can continue to use the cvs head, otherwise, it is broken.
anyone else have this problem?
mike


Index: dwarf2asm.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/dwarf2asm.c,v
retrieving revision 1.31
diff -u -r1.31 dwarf2asm.c
--- dwarf2asm.c	10 Jan 2003 02:22:00 -0000	1.31
+++ dwarf2asm.c	1 Feb 2003 02:15:29 -0000
@@ -687,7 +687,17 @@
 
   VA_CLOSE (ap);
 }
-\f
+
+/*
+mdupont for this silly gengtype
+*/
+
+#ifndef IN_GCC
+struct splay_tree_node_s;
+typedef struct splay_tree_s  *splay_tree;
+typedef struct splay_tree_node_s *splay_tree_node;
+#endif 
+
 static rtx dw2_force_const_mem PARAMS ((rtx));
 static int dw2_output_indirect_constant_1 PARAMS ((splay_tree_node,
void *));
 
@@ -710,58 +720,7 @@
 dw2_force_const_mem (x)
      rtx x;
 {
-  splay_tree_node node;
-  const char *str;
-  tree decl;
-
-  if (! indirect_pool)
-    indirect_pool = splay_tree_new_ggc (splay_tree_compare_pointers);
-
-  if (GET_CODE (x) != SYMBOL_REF)
-    abort ();
-
-  str = (* targetm.strip_name_encoding) (XSTR (x, 0));
-  node = splay_tree_lookup (indirect_pool, (splay_tree_key) str);
-  if (node)
-    decl = (tree) node->value;
-  else
-    {
-      tree id;
-
-      if (USE_LINKONCE_INDIRECT)
-	{
-	  char *ref_name = alloca (strlen (str) + sizeof "DW.ref.");
-
-	  sprintf (ref_name, "DW.ref.%s", str);
-	  id = get_identifier (ref_name);
-	  decl = build_decl (VAR_DECL, id, ptr_type_node);
-	  DECL_ARTIFICIAL (decl) = 1;
-	  TREE_PUBLIC (decl) = 1;
-	  DECL_INITIAL (decl) = decl;
-	  make_decl_one_only (decl);
-	}
-      else
-	{
-	  char label[32];
-
-	  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;
-	  TREE_STATIC (decl) = 1;
-	  DECL_INITIAL (decl) = decl;
-	}
-
-      id = maybe_get_identifier (str);
-      if (id)
-	TREE_SYMBOL_REFERENCED (id) = 1;
-
-      splay_tree_insert (indirect_pool, (splay_tree_key) str,
-			 (splay_tree_value) decl);
-    }
 
-  return XEXP (DECL_RTL (decl), 0);
 }
 
 /* A helper function for dw2_output_indirect_constants called through
@@ -771,17 +730,7 @@
 dw2_output_indirect_constant_1 (node, data)
      splay_tree_node node;
      void* data ATTRIBUTE_UNUSED;
-{
-  const char *sym;
-  rtx sym_ref;
-
-  sym = (const char *) node->key;
-  sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym);
-  if (USE_LINKONCE_INDIRECT)
-    fprintf (asm_out_file, "\t.hidden DW.ref.%s\n", sym);
-  assemble_variable ((tree) node->value, 1, 1, 1);
-  assemble_integer (sym_ref, POINTER_SIZE / BITS_PER_UNIT,
POINTER_SIZE, 1);
-
+{  
   return 0;
 }
 
@@ -790,8 +739,10 @@
 void
 dw2_output_indirect_constants ()
 {
+  /*
   if (indirect_pool)
     splay_tree_foreach (indirect_pool, dw2_output_indirect_constant_1,
NULL);
+  */
 }
 
 /* Like dw2_asm_output_addr_rtx, but encode the pointer as directed. 
*/
@@ -801,86 +752,7 @@
 					  rtx addr,
 					  const char *comment, ...))
 {
-  int size;
-
-  VA_OPEN (ap, comment);
-  VA_FIXEDARG (ap, int, encoding);
-  VA_FIXEDARG (ap, rtx, addr);
-  VA_FIXEDARG (ap, const char *, comment);
-
-  size = size_of_encoded_value (encoding);
-
-  if (encoding == DW_EH_PE_aligned)
-    {
-      assemble_align (POINTER_SIZE);
-      assemble_integer (addr, size, POINTER_SIZE, 1);
-      return;
-    }
-
-  /* NULL is _always_ represented as a plain zero, as is 1 for Ada's
-     "all others".  */
-  if (addr == const0_rtx || addr == const1_rtx)
-    assemble_integer (addr, size, BITS_PER_UNIT, 1);
-  else
-    {
-    restart:
-      /* Allow the target first crack at emitting this.  Some of the
-	 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,
-					 addr, done);
-#endif
-
-      /* Indirection is used to get dynamic relocations out of a
-	 read-only section.  */
-      if (encoding & DW_EH_PE_indirect)
-	{
-	  /* It is very tempting to use force_const_mem so that we share data
-	     with the normal constant pool.  However, we've already emitted
-	     the constant pool for this function.  Moreover, we'd like to
-	     share these constants across the entire unit of translation,
-	     or better, across the entire application (or DSO).  */
-	  addr = dw2_force_const_mem (addr);
-	  encoding &= ~DW_EH_PE_indirect;
-	  goto restart;
-	}
-
-      switch (encoding & 0xF0)
-	{
-	case DW_EH_PE_absptr:
-	  dw2_assemble_integer (size, addr);
-	  break;
-
-	case DW_EH_PE_pcrel:
-	  if (GET_CODE (addr) != SYMBOL_REF)
-	    abort ();
-#ifdef ASM_OUTPUT_DWARF_PCREL
-	  ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, XSTR (addr, 0));
-#else
-	  dw2_assemble_integer (size, gen_rtx_MINUS (Pmode, addr, pc_rtx));
-#endif
-	  break;
-
-	default:
-	  /* Other encodings should have been handled by
-	     ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX.  */
-	  abort ();
-	}
-
-#ifdef ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
-    done:;
-#endif
-    }
-
-  if (flag_debug_asm && comment)
-    {
-      fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
-      vfprintf (asm_out_file, comment, ap);
-    }
-  fputc ('\n', asm_out_file);
 
-  VA_CLOSE (ap);
 }
 
 #include "gt-dwarf2asm.h"

###################################################
contents of splay-gt.c you need that
do implement the calls.

void gt_ggc_m_SP9tree_node12splay_tree_s();
void gt_pch_n_SP9tree_node12splay_tree_s();
void gt_ggc_m_SP9tree_node12splay_tree_s()
{
}
void gt_pch_n_SP9tree_node12splay_tree_s()
{
}


=====
James Michael DuPont
http://introspector.sourceforge.net/

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-01  2:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-01  2:22 HACK : getting dwarf2asm.c to compile in CVS head James Michael DuPont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).