public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch: FYI: even more dead code from gcj, including WFL
@ 2007-01-15 22:42 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2007-01-15 22:42 UTC (permalink / raw)
  To: Java Patch List; +Cc: Gcc Patch List

I'm checking this in.

Steven Bosscher asked on irc about the use of WFL nodes in gcj,
pointing out that these prevent us from removing TREE_COMPLEXITY.
I looked today and, sure enough, we no longer generate theses nodes.

So, this patch removes all traces of WFL from gcj.  It also removes a
couple other macros and fields from lang-specific structs that I
happened to notice were dead.

Tested on x85 FC 5.

The only remaining uses of TREE_COMPLEXITY are in ada.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* lang.c (dump_compound_expr) <EXPR_WITH_FILE_LOCATION>: Removed
	case.
	* java-gimplify.c (java_gimplify_expr) <EXPR_WITH_FILE_LOCATION>:
	Removed case.
	* java-tree.h (EXPR_WFL_EMIT_LINE_NOTE): Removed.
	(EXPR_WFL_NODE): Likewise.
	(EXPR_WFL_LINECOL): Likewise.
	(EXPR_WFL_FILENAME): Likewise.
	(EXPR_WFL_LINENO): Likewise.
	(build_expr_wfl, expr_add_location): Don't declare.
	(build_unknown_wfl): Removed.
	(EXPR_WFL_FILENAME_NODE): Removed.
	(EXPR_WFL_COLNO): Removed.
	(EXPR_WFL_SET_LINECOL): Removed.
	(DECL_FUNCTION_WFL): Removed.
	(DECL_FIELD_FINAL_WFL): Removed.
	(struct lang_decl_func) <wfl>: Removed field.
	<called_constructor>: Likewise.
	<inner_access>: Likewise.
	(struct lang_decl_var) <wfl>: Removed field.
	(DECL_CONSTRUCTOR_CALLS): Removed.
	(DECL_FUNCTION_ACCESS_DECL): Likewise.
	(DECL_FUNCTION_INNER_ACCESS): Likewise.
	(DECL_SPECIFIC_COUNT): Likewise.
	* java-tree.def (EXPR_WITH_FILE_LOCATION): Removed.
	* expr.c (build_expr_wfl): Removed.
	(expr_add_location): Likewise.

Index: java-gimplify.c
===================================================================
--- java-gimplify.c	(revision 120801)
+++ java-gimplify.c	(working copy)
@@ -69,18 +69,6 @@
       *expr_p = java_gimplify_block (*expr_p);
       break;
 
-    case EXPR_WITH_FILE_LOCATION:
-#ifdef USE_MAPPED_LOCATION
-      input_location = EXPR_LOCATION (*expr_p);
-#else
-      input_location.file = EXPR_WFL_FILENAME (*expr_p);
-      input_location.line = EXPR_WFL_LINENO (*expr_p);
-#endif
-      *expr_p = EXPR_WFL_NODE (*expr_p);
-      if (EXPR_P (*expr_p))
-	SET_EXPR_LOCATION (*expr_p, input_location);
-      break;
-
     case LABELED_BLOCK_EXPR:
       *expr_p = java_gimplify_labeled_block_expr (*expr_p);
       break;
Index: java-tree.def
===================================================================
--- java-tree.def	(revision 120801)
+++ java-tree.def	(working copy)
@@ -24,19 +24,6 @@
    Operand 1 contains chained catch nodes. */
 DEFTREECODE (TRY_EXPR, "try-catch", tcc_expression, 2)
 
-/* Annotates a tree node (usually an expression) with source location
-   information: a file name (EXPR_WFL_FILENAME);  a line number
-   (EXPR_WFL_LINENO); and column number (EXPR_WFL_COLNO).  It is
-   expanded as the contained node (EXPR_WFL_NODE);  a line note should
-   be emitted first if EXPR_WFL_EMIT_LINE_NOTE.  */
-#ifdef USE_MAPPED_LOCATION
-DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location",
-	     tcc_expression, 2)
-#else
-DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location",
-	     tcc_expression, 3)
-#endif
-
 /*
 Local variables:
 mode:c
Index: expr.c
===================================================================
--- expr.c	(revision 120801)
+++ expr.c	(working copy)
@@ -3757,87 +3757,6 @@
   return node;
 }
 
-/* EXPR_WITH_FILE_LOCATION are used to keep track of the exact
-   location where an expression or an identifier were encountered. It
-   is necessary for languages where the frontend parser will handle
-   recursively more than one file (Java is one of them).  */
-
-tree
-build_expr_wfl (tree node,
-#ifdef USE_MAPPED_LOCATION
-		source_location location
-#else
-		const char *file, int line, int col
-#endif
-)
-{
-  tree wfl;
-
-#ifdef USE_MAPPED_LOCATION
-  wfl = make_node (EXPR_WITH_FILE_LOCATION);
-  SET_EXPR_LOCATION (wfl, location);
-#else
-  static const char *last_file = 0;
-  static tree last_filenode = NULL_TREE;
-
-  wfl = make_node (EXPR_WITH_FILE_LOCATION);
-
-  EXPR_WFL_SET_LINECOL (wfl, line, col);
-  if (file != last_file)
-    {
-      last_file = file;
-      last_filenode = file ? get_identifier (file) : NULL_TREE;
-    }
-  EXPR_WFL_FILENAME_NODE (wfl) = last_filenode;
-#endif
-  EXPR_WFL_NODE (wfl) = node;
-  if (node)
-    {
-      if (!TYPE_P (node))
-	TREE_SIDE_EFFECTS (wfl) = TREE_SIDE_EFFECTS (node);
-      TREE_TYPE (wfl) = TREE_TYPE (node);
-    }
-
-  return wfl;
-}
-
-#ifdef USE_MAPPED_LOCATION
-tree
-expr_add_location (tree node, source_location location, bool statement)
-{
-  tree wfl;
-#if 0
-  /* FIXME. This optimization causes failures in code that expects an
-     EXPR_WITH_FILE_LOCATION.  E.g. in resolve_qualified_expression_name. */
-  if (node && ! (statement && flag_emit_class_files))
-    {
-      source_location node_loc = EXPR_LOCATION (node);
-      if (node_loc == location || location == UNKNOWN_LOCATION)
-	return node;
-      if (node_loc == UNKNOWN_LOCATION
-	  && IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (node))))
-	{
-	  SET_EXPR_LOCATION (node, location);
-	  return node;
-	}
-    }
-#endif
-  wfl = make_node (EXPR_WITH_FILE_LOCATION);
-  SET_EXPR_LOCATION (wfl, location);
-  EXPR_WFL_NODE (wfl) = node;
-  if (statement && debug_info_level != DINFO_LEVEL_NONE)
-    EXPR_WFL_EMIT_LINE_NOTE (wfl) = 1;
-  if (node)
-    {
-      if (!TYPE_P (node))
-	TREE_SIDE_EFFECTS (wfl) = TREE_SIDE_EFFECTS (node);
-      TREE_TYPE (wfl) = TREE_TYPE (node);
-    }
-
-  return wfl;
-}
-#endif
-
 /* Build a node to represent empty statements and blocks. */
 
 tree
Index: lang.c
===================================================================
--- lang.c	(revision 120801)
+++ lang.c	(working copy)
@@ -876,13 +876,6 @@
 	  dump_compound_expr (di, TREE_OPERAND (t, i));
 	  break;
 
-	case EXPR_WITH_FILE_LOCATION:
-	    {
-	      tree wfl_node = EXPR_WFL_NODE (TREE_OPERAND (t, i));
-	      dump_child ("expr", wfl_node);
-	      break;
-	    }
-
 	default:
 	  dump_child ("expr", TREE_OPERAND (t, i));
 	}
Index: java-tree.h
===================================================================
--- java-tree.h	(revision 120801)
+++ java-tree.h	(working copy)
@@ -728,30 +728,13 @@
   (DECL_LANG_SPECIFIC(DECL)->u.f.arg_slot_count)
 /* Source location of end of function. */
 #define DECL_FUNCTION_LAST_LINE(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.last_line)
-/* Information on declaration location */
-#define DECL_FUNCTION_WFL(DECL)  (DECL_LANG_SPECIFIC(DECL)->u.f.wfl)
 /* List of checked thrown exceptions, as specified with the `throws'
    keyword */
 #define DECL_FUNCTION_THROWS(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.throws_list)
-/* List of other constructors of the same class that this constructor
-   calls */
-#define DECL_CONSTRUCTOR_CALLS(DECL) \
-  (DECL_LANG_SPECIFIC(DECL)->u.f.called_constructor)
-/* When the function is an access function, the DECL it was trying to
-   access */
-#define DECL_FUNCTION_ACCESS_DECL(DECL) \
-  (DECL_LANG_SPECIFIC(DECL)->u.f.called_constructor)
-/* The identifier of the access method used to invoke this method from
-   an inner class.  */
-#define DECL_FUNCTION_INNER_ACCESS(DECL) \
-  (DECL_LANG_SPECIFIC(DECL)->u.f.inner_access)
 /* Pointer to the function's current's COMPOUND_EXPR tree (while
    completing its body) or the function's block */
 #define DECL_FUNCTION_BODY(DECL) \
   (DECL_LANG_SPECIFIC(DECL)->u.f.function_decl_body)
-/* How specific the function is (for method selection - Java source
-   code front-end */
-#define DECL_SPECIFIC_COUNT(DECL) DECL_ARG_SLOT_COUNT(DECL)
 /* For each function decl, init_test_table contains a hash table whose
    entries are keyed on class names, and whose values are local
    boolean decls.  The variables are intended to be TRUE when the
@@ -819,8 +802,6 @@
 /* True if a final field was initialized upon its declaration
    or in an initializer.  Set after definite assignment.  */
 #define DECL_FIELD_FINAL_IUD(NODE)  (DECL_LANG_SPECIFIC (NODE)->u.v.final_iud)
-/* The original WFL of a final variable. */
-#define DECL_FIELD_FINAL_WFL(NODE)  (DECL_LANG_SPECIFIC(NODE)->u.v.wfl)
 /* The class that's the owner of a dynamic binding table.  */
 #define DECL_OWNER(NODE)            (DECL_LANG_SPECIFIC(NODE)->u.v.owner)
 /* True if NODE is a local variable final. */
@@ -888,11 +869,8 @@
   /* A temporary lie for the sake of ggc.  Actually, last_line is
      only a source_location if USE_MAPPED_LOCATION.  FIXME.  */
   source_location last_line;	/* End line number for a function decl */
-  tree wfl;			/* Information on the original location */
   tree throws_list;		/* Exception specified by `throws' */
   tree function_decl_body;	/* Hold all function's statements */
-  tree called_constructor;	/* When decl is a constructor, the
-				   list of other constructor it calls */
 
   /* Class initialization test variables  */
   htab_t GTY ((param_is (struct treetreehash_entry))) init_test_table;
@@ -900,8 +878,6 @@
   /* Initialized (static) Class Table */
   htab_t GTY ((param_is (union tree_node))) ict;
 
-  tree inner_access;		/* The identifier of the access method
-				   used for invocation from inner classes */
   unsigned int native : 1;	/* Nonzero if this is a native method  */
   unsigned int init_final : 1;	/* Nonzero all finals are initialized */
   unsigned int init_calls_this : 1;
@@ -972,7 +948,6 @@
   int end_pc;
   tree slot_chain;
   tree am;			/* Access method for this field (1.1) */
-  tree wfl;			/* Original wfl */
   tree owner;
   unsigned int final_iud : 1;	/* Final initialized upon declaration */
   unsigned int cif : 1;		/* True: decl is a class initialization flag */
@@ -1702,36 +1677,6 @@
 #define EXIT_BLOCK_LABELED_BLOCK(NODE) \
   TREE_OPERAND_CHECK_CODE (NODE, EXIT_BLOCK_EXPR, 0)
 
-/* In an EXPR_WITH_FILE_LOCATION node.  */
-#define EXPR_WFL_EMIT_LINE_NOTE(NODE) \
-  (EXPR_WITH_FILE_LOCATION_CHECK (NODE)->base.public_flag)
-#undef EXPR_WFL_NODE
-#define EXPR_WFL_NODE(NODE) \
-  TREE_OPERAND (EXPR_WITH_FILE_LOCATION_CHECK (NODE), 0)
-#ifdef USE_MAPPED_LOCATION
-#define EXPR_WFL_LINECOL(NODE) EXPR_LOCUS(NODE)
-#define EXPR_WFL_FILENAME(NODE) EXPR_FILENAME (NODE)
-#define EXPR_WFL_LINENO(NODE) EXPR_LINENO (NODE)
-extern tree build_expr_wfl (tree, source_location);
-extern tree expr_add_location (tree, source_location, bool);
-#define build_unknown_wfl(NODE) build_expr_wfl(NODE, UNKNOWN_LOCATION)
-#else
-#define EXPR_WFL_LINECOL(NODE) (EXPR_CHECK (NODE)->exp.complexity)
-#define EXPR_WFL_LINENO(NODE) (EXPR_WFL_LINECOL (NODE) >> 12)
-#define EXPR_WFL_COLNO(NODE) (EXPR_WFL_LINECOL (NODE) & 0xfff)
-#undef EXPR_WFL_FILENAME_NODE
-#define EXPR_WFL_FILENAME_NODE(NODE) \
-  TREE_OPERAND (EXPR_WITH_FILE_LOCATION_CHECK (NODE), 2)
-#define EXPR_WFL_FILENAME(NODE) \
-  IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE (NODE))
-/* ??? Java uses this in all expressions.  */
-#define EXPR_WFL_SET_LINECOL(NODE, LINE, COL) \
-  (EXPR_WFL_LINECOL(NODE) = ((LINE) << 12) | ((COL) & 0xfff))
-
-extern tree build_expr_wfl (tree, const char *, int, int);
-#define build_unknown_wfl(NODE) build_expr_wfl(NODE, NULL, 0, 0)
-#endif
-
 extern void java_genericize (tree);
 extern int java_gimplify_expr (tree *, tree *, tree *);
 

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

only message in thread, other threads:[~2007-01-15 22:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-15 22:42 Patch: FYI: even more dead code from gcj, including WFL Tom Tromey

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).