This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: misc. tree-generation fixes
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 12 Feb 2005 20:40:25 -0700
- Subject: [gcjx] Patch: FYI: misc. tree-generation fixes
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
This patch has a few miscellaneous tree-generation fixes.
Now:
- we handle super.m() more correctly.
- we lay out the class record, not the pointer to the class record
- we set the name of the class
Tom
#
# patch "gcc/gcc/java/ChangeLog"
# from [2b531f8104bac4f4f86d8662d8d538fd18b9f1ec]
# to [64886e3486220af424d296583fff24394b1df9e9]
#
# patch "gcc/gcc/java/builtins.cc"
# from [3becc2129ce4daa8c1ecbac7459b56c984faac22]
# to [0407b9037ce5b0d5cc75d2c9bd74889de0859074]
#
# patch "gcc/gcc/java/tree.cc"
# from [5c8482d185e2e8c72f80c0bef52f261e80f6da64]
# to [d4ea0044dbe96fc1d23a996996d92f0a90b6ead1]
#
# patch "gcc/gcjx/ChangeLog"
# from [c6a367ee0339ce75a549b6be4c07f7b259e38300]
# to [9434ac3319d0fe365086c15d45f64d87e1ec4f69]
#
--- gcc/gcc/java/ChangeLog
+++ gcc/gcc/java/ChangeLog
@@ -1,3 +1,10 @@
+2005-02-07 Tom Tromey <tromey@redhat.com>
+
+ * tree.cc (visit_type_qualified_invocation): Pass 'super' to
+ handle_invocation. Handle static methods correctly.
+ * builtins.cc (map_type): Assign a name to the type.
+ (lay_out_class): Lay out class record type.
+
2005-02-06 Tom Tromey <tromey@redhat.com>
* treegen.hh (tree_code_generator::handles_class_p): New method.
--- gcc/gcc/java/builtins.cc
+++ gcc/gcc/java/builtins.cc
@@ -232,10 +232,14 @@
else
record = make_node (RECORD_TYPE);
TYPE_BINFO (record) = make_tree_binfo (0);
+ TYPE_NAME (record) = map_identifier (klass->get_fully_qualified_name ());
+ // FIXME: make a NAMESPACE_DECL and use it as the DECL_CONTEXT.
+
// FIXME: pushdecl() ?
- tree decl = build_decl (TYPE_DECL, map_identifier (klass->get_name ()),
- record);
+ // FIXME: should we use the class's name or its fully qualified
+ // name? For the moment we use the latter.
+ tree decl = build_decl (TYPE_DECL, TYPE_NAME (record), record);
// FIXME: this isn't right... but we use it elsewhere.
TYPE_STUB_DECL (record) = decl;
@@ -435,7 +439,7 @@
lay_out_vtable (klass);
- layout_type (klass_tree);
+ layout_type (klass_record);
return klass_tree;
}
--- gcc/gcc/java/tree.cc
+++ gcc/gcc/java/tree.cc
@@ -1640,12 +1640,13 @@
void
tree_generator::visit_type_qualified_invocation
-(model_type_qualified_invocation *,
- const model_method *meth,
- const std::list<ref_expression> &args,
- bool super)
+ (model_type_qualified_invocation *,
+ const model_method *meth,
+ const std::list<ref_expression> &args,
+ bool super)
{
- handle_invocation (meth, meth->static_p () ? this_tree : NULL_TREE, args);
+ handle_invocation (meth, meth->static_p () ? NULL_TREE : this_tree, args,
+ super);
}
void