public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gcjx] Patch: FYI: remove some casts
@ 2005-10-09 21:59 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2005-10-09 21:59 UTC (permalink / raw)
  To: Java Patch List

I'm checking this in on the gcjx branch.

The recent visitor changes made some casts unnecessary.  This removes
them.

Tom

Index: gcjx/ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* bytecode/generate.cc (visit_field_ref): Removed unneeded casts.

Index: gcc/java/ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* tree.cc (visit_field_ref): Removed unneeded cast.

Index: gcjx/bytecode/generate.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/bytecode/Attic/generate.cc,v
retrieving revision 1.1.2.23
diff -u -r1.1.2.23 generate.cc
--- gcjx/bytecode/generate.cc 9 Oct 2005 01:42:27 -0000 1.1.2.23
+++ gcjx/bytecode/generate.cc 9 Oct 2005 21:58:20 -0000
@@ -2709,8 +2709,7 @@
   // From the binary compatibility spec, we must inline any 'final'
   // field that has an initializer which is a compile-time constant.
   // This applies to both instance and static fields.
-  // FIXME: ugly cast here.
-  bool should_inline = const_cast<model_field *> (field)->inlineable_p ();
+  bool should_inline = field->inlineable_p ();
 
   if (expr)
     {
@@ -2745,9 +2744,7 @@
     {
       // Emit a call to the trampoline method.
       model_method *tm
-	// FIXME: remove this cast.
-	= accessed->get_accessor (const_cast<model_field *> (field),
-				  expr_target == LEFT_HAND_SIDE);
+	= accessed->get_accessor (field, expr_target == LEFT_HAND_SIDE);
       assert (tm->static_p ());
 
       if (expr_target == LEFT_HAND_SIDE)
@@ -2756,8 +2753,7 @@
 	  lhs_info.kind = METHOD_CALL;
 	  lhs_info.index = -1;
 	  lhs_info.type = field->static_p () ? accessed : expr->type ();
-	  // FIXME: cast
-	  lhs_info.field = const_cast<model_field *> (field);
+	  lhs_info.field = field;
 	}
       else
 	{
@@ -2770,12 +2766,9 @@
     {
       assert (! expr || ! expr->type ()->array_p ());
       lhs_info.kind = field->static_p () ? STATIC_FIELD : INSTANCE_FIELD;
-      // fixme cast
-      lhs_info.index = cpool->add (ref->get_qualifying_class (),
-				   (model_field *) field);
+      lhs_info.index = cpool->add (ref->get_qualifying_class (), field);
       lhs_info.type = field->static_p () ? NULL : expr->type ();
-      // fixme cast
-      lhs_info.field = (model_field *) field;
+      lhs_info.field = field;
     }
   else
     {
@@ -2787,9 +2780,7 @@
       else
 	{
 	  emit (field->static_p () ? op_getstatic : op_getfield);
-	  // fixme cast
-	  emit2 (cpool->add (ref->get_qualifying_class (),
-			     (model_field *) field));
+	  emit2 (cpool->add (ref->get_qualifying_class (), field));
 	}
 
       if (expr && ! field->static_p ())
Index: gcc/java/tree.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/tree.cc,v
retrieving revision 1.1.2.52
diff -u -r1.1.2.52 tree.cc
--- gcc/java/tree.cc 9 Oct 2005 21:51:12 -0000 1.1.2.52
+++ gcc/java/tree.cc 9 Oct 2005 21:58:28 -0000
@@ -1966,8 +1966,7 @@
 #endif
 
       gcc_builtins->lay_out_class (field->get_declaring_class ());
-      current = gcc_builtins->map_field_ref (class_wrapper, expr_tree,
-					     const_cast<model_field *> (field));
+      current = gcc_builtins->map_field_ref (class_wrapper, expr_tree, field);
       annotate (current, elt);
     }
 }

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

only message in thread, other threads:[~2005-10-09 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-09 21:59 [gcjx] Patch: FYI: remove some casts 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).