public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gcjx] Patch: FYI: compiling gcj front end
@ 2005-10-09 21:51 Tom Tromey
  2005-10-10  6:28 ` Ranjit Mathew
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2005-10-09 21:51 UTC (permalink / raw)
  To: Java Patch List

I'm checking this in on the gcjx branch.

This makes it possible to compile the gcj front end again.

Tom

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

	* tree.cc (visit_field_ref): Removed 'const'.
	(visit_method_invocation): Likewise.

Index: tree.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/tree.cc,v
retrieving revision 1.1.2.51
diff -u -r1.1.2.51 tree.cc
--- tree.cc 4 Oct 2005 22:15:27 -0000 1.1.2.51
+++ tree.cc 9 Oct 2005 21:50:34 -0000
@@ -1920,9 +1920,9 @@
 void
 tree_generator::visit_field_ref (model_field_ref *elt,
 				 const ref_expression &expr,
-				 const model_field *field)
+				 model_field *field)
 {
-  bool should_inline = const_cast<model_field *> (field)->inlineable_p ();
+  bool should_inline = field->inlineable_p ();
 
   // Note that we don't need any special handling for 'array.length'
   // -- the generic code here works fine.
@@ -2164,7 +2164,7 @@
 
 void
 tree_generator::visit_method_invocation (model_method_invocation *elt,
-					 const model_method *meth,
+					 model_method *meth,
 					 const ref_expression &this_expr,
 					 const std::list<ref_expression> &args)
 {

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gcjx] Patch: FYI: compiling gcj front end
  2005-10-09 21:51 [gcjx] Patch: FYI: compiling gcj front end Tom Tromey
@ 2005-10-10  6:28 ` Ranjit Mathew
  2005-10-11  4:24   ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Ranjit Mathew @ 2005-10-10  6:28 UTC (permalink / raw)
  To: tromey; +Cc: java-patches

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Tromey wrote:
> I'm checking this in on the gcjx branch.
> 
> This makes it possible to compile the gcj front end again.

[...]

> 	* tree.cc (visit_field_ref): Removed 'const'.
> 	(visit_method_invocation): Likewise.

I *did* make those changes along with the patch to implement
the pretty-printer:

http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/Attic/tree.hh.diff?r1=1.1.2.15&r2=1.1.2.16&only_with_tag=gcjx-branch

I think you refreshed your tree just in the window it took
me to apply my "gcjx" patch followed by the "gcc/java" patch. :-/

I had to remove these "const" qualifiers in a few visitor
methods because when I wrote "foo->visit (this)", the
compiler complained about it since visit() was not a "const"
method. My choices were to either add the "const" qualifiers
to all the visit_xxx() methods or remove the "const" from
these parameters. I took the latter option not only because
it was simpler to implement and I am lazy, but also because
I was not totally sure if tree walkers were not supposed to
modify the tree while walking.

I now realise that visiting these "model_method *" or "model_field *"
would be redundant and we could just print their names in the
pretty-printer. I was therefore going to add back the "const"
qualifiers, but now I see that you're actually using this to
remove const_cast from some places.

So I don't think I should add back these qualifiers, no?

Thanks,
Ranjit.

- --
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web: http://ranjitmathew.hostingzero.com/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDSgoBYb1hx2wRS48RAoToAKCmXARpqdswLi0WJMyJIoHRgfJIfgCgj1Fw
fghMI+4bwwjCij5aWmKYqLo=
=PjWc
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gcjx] Patch: FYI: compiling gcj front end
  2005-10-10  6:28 ` Ranjit Mathew
@ 2005-10-11  4:24   ` Tom Tromey
  2005-10-11  5:45     ` Ranjit Mathew
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2005-10-11  4:24 UTC (permalink / raw)
  To: Ranjit Mathew; +Cc: java-patches

>>>>> "Ranjit" == Ranjit Mathew <rmathew@gmail.com> writes:

Ranjit> I think you refreshed your tree just in the window it took
Ranjit> me to apply my "gcjx" patch followed by the "gcc/java" patch. :-/

Actually my patch was against tree.cc -- both the .hh and the .cc file
had to be touched in this case.

Ranjit> I took the latter option not only because
Ranjit> it was simpler to implement and I am lazy, but also because
Ranjit> I was not totally sure if tree walkers were not supposed to
Ranjit> modify the tree while walking.

Yeah.  In general I think the visitors shouldn't be modifying the
model, but in practice there may be situations where it is needed.
Honestly I'm not certain :-(, at least not without doing some
investigation.

Ranjit> I now realise that visiting these "model_method *" or "model_field *"
Ranjit> would be redundant and we could just print their names in the
Ranjit> pretty-printer. I was therefore going to add back the "const"
Ranjit> qualifiers, but now I see that you're actually using this to
Ranjit> remove const_cast from some places.

Ranjit> So I don't think I should add back these qualifiers, no?

Let's leave them off.

Tom

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gcjx] Patch: FYI: compiling gcj front end
  2005-10-11  4:24   ` Tom Tromey
@ 2005-10-11  5:45     ` Ranjit Mathew
  2005-10-11 14:54       ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Ranjit Mathew @ 2005-10-11  5:45 UTC (permalink / raw)
  To: tromey; +Cc: java-patches

On 10 Oct 2005 22:17:28 -0600, Tom Tromey <tromey@redhat.com> wrote:
> >>>>> "Ranjit" == Ranjit Mathew <rmathew@gmail.com> writes:
>
> Ranjit> I think you refreshed your tree just in the window it took
> Ranjit> me to apply my "gcjx" patch followed by the "gcc/java" patch. :-/
>
> Actually my patch was against tree.cc -- both the .hh and the .cc file
> had to be touched in this case.

Oops! I am terribly sorry in that case.

Looks like I can't rely on a "make bubblestrap" for such
cases. (Or perhaps this is because there's no explicit
dependency of tree.cc on tree.hh?)

Thanks,
Ranjit.

--
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web: http://ranjitmathew.hostingzero.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gcjx] Patch: FYI: compiling gcj front end
  2005-10-11  5:45     ` Ranjit Mathew
@ 2005-10-11 14:54       ` Tom Tromey
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2005-10-11 14:54 UTC (permalink / raw)
  To: Ranjit Mathew; +Cc: java-patches

>>>>> "Ranjit" == Ranjit Mathew <rmathew@gmail.com> writes:

Ranjit> Looks like I can't rely on a "make bubblestrap" for such
Ranjit> cases. (Or perhaps this is because there's no explicit
Ranjit> dependency of tree.cc on tree.hh?)

Yeah, looks like I didn't add dependencies to Make-lang.in.
There's always 'make java.mostlyclean' :-}

Tom

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-10-11 14:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-09 21:51 [gcjx] Patch: FYI: compiling gcj front end Tom Tromey
2005-10-10  6:28 ` Ranjit Mathew
2005-10-11  4:24   ` Tom Tromey
2005-10-11  5:45     ` Ranjit Mathew
2005-10-11 14:54       ` 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).