This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Generalise visitor
- From: Ranjit Mathew <rmathew at gmail dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Thu, 06 Oct 2005 23:17:38 +0530
- Subject: [gcjx] Generalise visitor
- Openpgp: url=http://ranjitmathew.hostingzero.com/aa_6C114B8F.txt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I wanted to implement an equivalent of debug_tree() for GCJX, but
found that the current visitor does not accept all model element
tree nodes. The attached patche make model_element provide a
visit() method and extends visitor to accept a few more classes.
The new methods are not exhaustive, but it's a start - technically,
I could have just added visit() to model_element and a visit_element()
to visitor and be done with it. However, I've attempted to declare
a few more. The implementations of the methods are dummies for now.
If this is not too gross, may I apply it?
There's another patch to fix "gcc/java" for the new changes.
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 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDRWM6Yb1hx2wRS48RAqK8AJ9sWomhBAPdvV1WXjxPRo5yPv9n8gCeNSa4
SvGGAKPo9uWEAxS0WV8vXx0=
=HLZi
-----END PGP SIGNATURE-----
Index: ChangeLog
from Ranjit Mathew <rmathew@gcc.gnu.org>
* visitor.hh (visitor::visit_forwarding_type): New method.
(visitor::visit_variable_decl): Likewise.
(visitor::visit_parameter_decl): Likewise.
(visitor::visit_catch_decl): Likewise.
(visitor::visit_package): Likewise.
(visitor::visit_primitive): Likewise.
(visitor::visit_type): Likewise.
(visitor::visit_identifier): Likewise.
(visitor::visit_element): Likewise.
* model/element.hh (model_element::visit): New method.
* model/element.cc: New file.
* model/identifier.hh (model_identifier::visit): New method.
* model/identifier.cc: New file.
* model/fwdtype.hh (model_forwarding_type::visit): New method.
* model/fwdtype.cc (model_forwarding_type::visit): Implement.
* model/variable.hh (model_variable::visit): New method.
(model_parameter_decl::visit): Likewise.
(model_catch_decl::visit): Likewise.
* model/variable.cc (model_variable::visit): Implement.
(model_parameter_decl::visit): Likewise.
(model_catch_decl::visit): Likewise.
* model/package.hh (model_package::visit): New method.
* model/package.cc (model_package::visit): Implement.
* model/primitive.hh (model_primitive_base::visit): New method.
* model/primitive.cc (model_primitive_base::visit): Implement.
* model/type.hh (model_type::visit): New method.
* model/type.cc (model_type::visit): Implement.
* model/javadoc.hh (model_javadoc::visit): New method.
* bytecode/generate.hh: Dummy implementations of new visitor methods.
* defassign.cc: Likewise.
* dump.cc: Likewise.
* fold.cc: Likewise.
* Makefile.am (model_sources): Add "model/element.cc" and
"model/identifier.cc".
* Makefile.in: Regenerated.
Index: visitor.hh
===================================================================
--- visitor.hh 2005-10-05 06:52:29.000000000 +0530
+++ visitor.hh 2005-10-06 21:54:23.000000000 +0530
@@ -337,6 +337,41 @@ public:
virtual void visit_simple_variable_ref (model_simple_variable_ref *,
const model_variable_decl *) = 0;
+
+ virtual void visit_forwarding_type (model_forwarding_type *,
+ const model_type *) = 0;
+
+ virtual void visit_variable_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool) = 0;
+
+ virtual void visit_parameter_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool) = 0;
+
+ virtual void visit_catch_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool) = 0;
+
+ virtual void visit_package (model_package *,
+ const std::list<std::string> &) = 0;
+
+ virtual void visit_primitive (model_primitive_base *, const char *) = 0;
+
+ virtual void visit_type (model_type *, const std::string &) = 0;
+
+ virtual void visit_identifier (model_identifier *, const std::string &) = 0;
+
+ virtual void visit_element (model_element *) = 0;
};
Index: model/element.hh
===================================================================
--- model/element.hh 2005-10-05 06:52:53.000000000 +0530
+++ model/element.hh 2005-10-06 21:51:56.000000000 +0530
@@ -1,6 +1,6 @@
// Represent an element.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -94,6 +94,11 @@ public:
{
return where;
}
+
+ /// Call the appropriate method of the visitor with information
+ /// about the tree.
+ /// @param v the visitor to call
+ virtual void visit (visitor *v);
};
#endif // GCJX_MODEL_ELEMENT_HH
Index: model/element.cc
===================================================================
--- model/element.cc 2005-10-06 21:50:24.000000000 +0530
+++ model/element.cc 2005-10-06 21:56:41.000000000 +0530
@@ -0,0 +1,28 @@
+// An element.
+
+// Copyright (C) 2005 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// gcjx is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// gcjx is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with gcjx; see the file COPYING.LIB. If
+// not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#include "typedefs.hh"
+
+void
+model_element::visit (visitor *v)
+{
+ v->visit_element (this);
+}
Index: model/identifier.hh
===================================================================
--- model/identifier.hh 2005-10-05 22:07:06.000000000 +0530
+++ model/identifier.hh 2005-10-06 21:52:08.000000000 +0530
@@ -1,6 +1,6 @@
// An identifier.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -40,6 +40,8 @@ public:
{
return identifier;
}
+
+ virtual void visit (visitor *);
};
#endif // GCJX_MODEL_IDENTIFIER_HH
Index: model/identifier.cc
===================================================================
--- model/identifier.cc 2005-10-06 21:52:16.000000000 +0530
+++ model/identifier.cc 2005-10-06 21:56:30.000000000 +0530
@@ -0,0 +1,28 @@
+// An identifier.
+
+// Copyright (C) 2005 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// gcjx is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// gcjx is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with gcjx; see the file COPYING.LIB. If
+// not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#include "typedefs.hh"
+
+void
+model_identifier::visit (visitor *v)
+{
+ v->visit_identifier (this, identifier);
+}
Index: model/fwdtype.hh
===================================================================
--- model/fwdtype.hh 2005-10-05 06:56:42.000000000 +0530
+++ model/fwdtype.hh 2005-10-05 19:29:57.000000000 +0530
@@ -69,6 +69,8 @@ public:
{
return false;
}
+
+ virtual void visit (visitor *);
};
/// This is a forwarding type whose target is already known when the
Index: model/fwdtype.cc
===================================================================
--- model/fwdtype.cc 2005-10-05 19:30:07.000000000 +0530
+++ model/fwdtype.cc 2005-10-05 19:31:12.000000000 +0530
@@ -41,6 +41,12 @@ model_forwarding_type::resolve_classes (
}
}
+void
+model_forwarding_type::visit (visitor *v)
+{
+ v->visit_forwarding_type (this, resolved_type);
+}
+
void
Index: model/variable.hh
===================================================================
--- model/variable.hh 2005-10-05 19:32:20.000000000 +0530
+++ model/variable.hh 2005-10-05 19:38:04.000000000 +0530
@@ -161,6 +161,8 @@ public:
}
virtual void check_referenced (resolution_scope *);
+
+ virtual void visit (visitor *);
};
/// This is a variable that happens to be a method parameter.
@@ -197,6 +199,8 @@ public:
}
void check_referenced (resolution_scope *);
+
+ virtual void visit (visitor *);
};
/// This is a variable that happens to be a 'catch' parameter.
@@ -238,6 +242,8 @@ public:
// are not used. Perhaps we should and just make the user use
// SuppressWarnings?
}
+
+ virtual void visit (visitor *);
};
#endif // GCJX_MODEL_VARIABLE_HH
Index: model/variable.cc
===================================================================
--- model/variable.cc 2005-10-05 19:33:50.000000000 +0530
+++ model/variable.cc 2005-10-05 19:39:08.000000000 +0530
@@ -98,6 +98,12 @@ model_variable_decl::check_referenced (r
}
void
+model_variable_decl::visit (visitor *v)
+{
+ v->visit_variable_decl (this, name, decltype, initializer, final, used);
+}
+
+void
model_parameter_decl::check_referenced (resolution_scope *scope)
{
warning_scope::push_warnings push (scope, this);
@@ -106,3 +112,15 @@ model_parameter_decl::check_referenced (
"parameter %1 unused")
% this->get_name ();
}
+
+void
+model_parameter_decl::visit (visitor *v)
+{
+ v->visit_parameter_decl (this, name, decltype, initializer, final, used);
+}
+
+void
+model_catch_decl::visit (visitor *v)
+{
+ v->visit_catch_decl (this, name, decltype, initializer, final, used);
+}
Index: model/package.hh
===================================================================
--- model/package.hh 2005-10-05 19:42:00.000000000 +0530
+++ model/package.hh 2005-10-05 19:42:34.000000000 +0530
@@ -117,6 +117,8 @@ public:
{
return join (name, '/');
}
+
+ virtual void visit (visitor *);
};
class model_unnamed_package : public model_package
Index: model/package.cc
===================================================================
--- model/package.cc 2005-10-05 19:42:48.000000000 +0530
+++ model/package.cc 2005-10-05 21:39:54.000000000 +0530
@@ -1,6 +1,6 @@
// Package representation.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -82,6 +82,12 @@ model_package::find_class (const std::st
return result;
}
+void
+model_package::visit (visitor *v)
+{
+ v->visit_package (this, name);
+}
+
const format &
operator% (const format &fmt, model_package *pkg)
{
Index: model/primitive.hh
===================================================================
--- model/primitive.hh 2005-10-05 20:41:07.000000000 +0530
+++ model/primitive.hh 2005-10-05 20:41:42.000000000 +0530
@@ -1,6 +1,6 @@
// Represent primitive types.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -199,6 +199,8 @@ public:
{
abort ();
}
+
+ virtual void visit (visitor *);
};
class model_primitive_boolean : public model_primitive_base
Index: model/primitive.cc
===================================================================
--- model/primitive.cc 2005-10-05 20:41:57.000000000 +0530
+++ model/primitive.cc 2005-10-05 20:43:07.000000000 +0530
@@ -1,6 +1,6 @@
// Primitive types.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -29,6 +29,12 @@ model_primitive_base::assignable_from_p
return assignment_conversion (this, other) != NULL;
}
+void
+model_primitive_base::visit (visitor *v)
+{
+ v->visit_primitive (this, pretty_name);
+}
+
template<typename T, char sig_char, long long MIN, long long MAX>
jvalue
model_int_primitive<T,sig_char,MIN,MAX>::divide (model_element *request,
Index: model/type.hh
===================================================================
--- model/type.hh 2005-10-05 21:20:51.000000000 +0530
+++ model/type.hh 2005-10-05 21:21:38.000000000 +0530
@@ -1,6 +1,6 @@
// Represent a type, primitive or not.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -152,6 +152,8 @@ public:
// Return a "pretty" name for this type. This is a name that the
// user is likely to recognize as a type name.
virtual std::string get_pretty_name () const = 0;
+
+ virtual void visit (visitor *);
};
const format &operator% (const format &fmt, const model_type *t);
Index: model/type.cc
===================================================================
--- model/type.cc 2005-10-05 21:21:44.000000000 +0530
+++ model/type.cc 2005-10-05 21:23:07.000000000 +0530
@@ -1,6 +1,6 @@
// Implementation of type base class.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -51,6 +51,12 @@ model_type::erasure ()
return this;
}
+void
+model_type::visit (visitor *v)
+{
+ v->visit_type (this, descriptor);
+}
+
const format &
operator% (const format &fmt, const model_type *t)
{
Index: model/javadoc.hh
===================================================================
--- model/javadoc.hh 2005-10-05 21:54:03.000000000 +0530
+++ model/javadoc.hh 2005-10-05 21:55:02.000000000 +0530
@@ -1,6 +1,6 @@
// Represent a javadoc comment.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -43,6 +43,11 @@ public:
{
return deprecated;
}
+
+ virtual void visit (visitor *)
+ {
+ // Nothing.
+ }
};
#endif // GCJX_MODEL_JAVADOC_HH
Index: bytecode/generate.hh
===================================================================
--- bytecode/generate.hh 2005-10-06 22:23:04.000000000 +0530
+++ bytecode/generate.hh 2005-10-06 22:24:16.000000000 +0530
@@ -710,6 +710,67 @@ public:
void visit_simple_variable_ref (model_simple_variable_ref *,
const model_variable_decl *);
+
+ void visit_forwarding_type (model_forwarding_type *,
+ const model_type *)
+ {
+ // Nothing.
+ }
+
+ void visit_variable_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_parameter_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_catch_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_package (model_package *, const std::list<std::string> &)
+ {
+ // Nothing.
+ }
+
+ void visit_primitive (model_primitive_base *, const char *)
+ {
+ // Nothing.
+ }
+
+ void visit_type (model_type *, const std::string &)
+ {
+ // Nothing.
+ }
+
+ void visit_identifier (model_identifier *, const std::string &)
+ {
+ // Nothing.
+ }
+
+ void visit_element (model_element *)
+ {
+ // Nothing.
+ }
};
#endif // GCJX_BYTECODE_GENERATE_HH
Index: defassign.cc
===================================================================
--- defassign.cc 2005-10-05 20:25:58.000000000 +0530
+++ defassign.cc 2005-10-06 21:55:46.000000000 +0530
@@ -1518,6 +1518,66 @@ public:
}
}
+ void visit_forwarding_type (model_forwarding_type *, const model_type *)
+ {
+ // Nothing.
+ }
+
+ void visit_variable_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_parameter_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_catch_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_package (model_package *, const std::list<std::string> &)
+ {
+ // Nothing.
+ }
+
+ void visit_primitive (model_primitive_base *, const char *)
+ {
+ // Nothing.
+ }
+
+ void visit_type (model_type *, const std::string &)
+ {
+ // Nothing.
+ }
+
+ void visit_identifier (model_identifier *, const std::string &)
+ {
+ // Nothing.
+ }
+
+ void visit_element (model_element *)
+ {
+ // Nothing.
+ }
+
// This is a helper for visiting a subexpression. It handles
// boolean expressions for the caller, merging final states if
// needed.
Index: dump.cc
===================================================================
--- dump.cc 2005-10-05 20:31:39.000000000 +0530
+++ dump.cc 2005-10-06 21:55:59.000000000 +0530
@@ -1,6 +1,6 @@
// Print the model for debugging.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -929,6 +929,67 @@ public:
{
out << var->get_name ();
}
+
+ void visit_forwarding_type (model_forwarding_type *,
+ const model_type *)
+ {
+ // Nothing.
+ }
+
+ void visit_variable_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_parameter_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_catch_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_package (model_package *, const std::list<std::string> &)
+ {
+ // Nothing.
+ }
+
+ void visit_primitive (model_primitive_base *, const char *)
+ {
+ // Nothing.
+ }
+
+ void visit_type (model_type *, const std::string &)
+ {
+ // Nothing.
+ }
+
+ void visit_identifier (model_identifier *, const std::string &)
+ {
+ // Nothing.
+ }
+
+ void visit_element (model_element *)
+ {
+ // Nothing.
+ }
};
void
Index: fold.cc
===================================================================
--- fold.cc 2005-10-05 20:38:01.000000000 +0530
+++ fold.cc 2005-10-06 21:55:33.000000000 +0530
@@ -1,6 +1,6 @@
// Constant folding.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -625,6 +625,67 @@ public:
{
}
+ void visit_forwarding_type (model_forwarding_type *,
+ const model_type *)
+ {
+ // Nothing.
+ }
+
+ void visit_variable_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_parameter_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_catch_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_package (model_package *, const std::list<std::string> &)
+ {
+ // Nothing.
+ }
+
+ void visit_primitive (model_primitive_base *, const char *)
+ {
+ // Nothing.
+ }
+
+ void visit_type (model_type *, const std::string &)
+ {
+ // Nothing.
+ }
+
+ void visit_identifier (model_identifier *, const std::string &)
+ {
+ // Nothing.
+ }
+
+ void visit_element (model_element *)
+ {
+ // Nothing.
+ }
+
ref_expression fold (const ref_expression &expr)
{
if (expr->constant_p ())
Index: Makefile.am
===================================================================
--- Makefile.am 2005-10-06 21:22:21.000000000 +0530
+++ Makefile.am 2005-10-06 21:30:29.000000000 +0530
@@ -86,19 +86,19 @@ model/arraytype.cc model/assert.cc model
model/block.cc model/blockscope.cc model/break.cc model/bytecode.cc \
model/cast.cc model/catch.cc model/class.cc model/classinst.cc \
model/classref.cc model/cond.cc model/constructor.cc model/continue.cc \
-model/declstmt.cc model/do.cc model/empty.cc model/enum.cc \
-model/expr.cc model/exprstmt.cc model/field.cc model/fieldinit.cc \
-model/fieldref.cc model/for.cc model/forenhanced.cc model/fwdtype.cc \
-model/iannotatable.cc model/if.cc model/import.cc model/imodifiable.cc \
-model/init.cc model/instanceof.cc model/invoke.cc model/label.cc \
-model/literal.cc model/memberref.cc model/method.cc model/modifier.cc \
-model/newarray.cc model/new.cc model/null.cc model/package.cc \
-model/parameters.cc model/primitive.cc model/return.cc model/stmt.cc \
-model/switch.cc model/synchronized.cc model/this.cc model/throw.cc \
-model/throwsclause.cc model/try.cc model/type.cc model/typemap.cc \
-model/typevar.cc model/unary.cc model/unit.cc model/value.cc \
-model/variable.cc model/varref.cc model/varstmt.cc model/while.cc \
-model/wildcard.cc
+model/declstmt.cc model/do.cc model/element.cc model/empty.cc \
+model/enum.cc model/expr.cc model/exprstmt.cc model/field.cc \
+model/fieldinit.cc model/fieldref.cc model/for.cc model/forenhanced.cc \
+model/fwdtype.cc model/iannotatable.cc model/identifier.cc model/if.cc \
+model/import.cc model/imodifiable.cc model/init.cc model/instanceof.cc \
+model/invoke.cc model/label.cc model/literal.cc model/memberref.cc \
+model/method.cc model/modifier.cc model/newarray.cc model/new.cc \
+model/null.cc model/package.cc model/parameters.cc model/primitive.cc \
+model/return.cc model/stmt.cc model/switch.cc model/synchronized.cc \
+model/this.cc model/throw.cc model/throwsclause.cc model/try.cc \
+model/type.cc model/typemap.cc model/typevar.cc model/unary.cc \
+model/unit.cc model/value.cc model/variable.cc model/varref.cc \
+model/varstmt.cc model/while.cc model/wildcard.cc
bytecode_sources = bytecode/attribute.cc bytecode/block.cc \
bytecode/bytegen.cc bytecode/classreader.cc bytecode/classwriter.cc \
Index: Makefile.in
===================================================================
--- Makefile.in 2005-10-06 21:22:21.000000000 +0530
+++ Makefile.in 2005-10-06 22:49:44.000000000 +0530
@@ -81,21 +81,22 @@ am__objects_2 = model/annotation.lo mode
model/break.lo model/bytecode.lo model/cast.lo model/catch.lo \
model/class.lo model/classinst.lo model/classref.lo \
model/cond.lo model/constructor.lo model/continue.lo \
- model/declstmt.lo model/do.lo model/empty.lo model/enum.lo \
- model/expr.lo model/exprstmt.lo model/field.lo \
+ model/declstmt.lo model/do.lo model/element.lo model/empty.lo \
+ model/enum.lo model/expr.lo model/exprstmt.lo model/field.lo \
model/fieldinit.lo model/fieldref.lo model/for.lo \
model/forenhanced.lo model/fwdtype.lo model/iannotatable.lo \
- model/if.lo model/import.lo model/imodifiable.lo model/init.lo \
- model/instanceof.lo model/invoke.lo model/label.lo \
- model/literal.lo model/memberref.lo model/method.lo \
- model/modifier.lo model/newarray.lo model/new.lo model/null.lo \
- model/package.lo model/parameters.lo model/primitive.lo \
- model/return.lo model/stmt.lo model/switch.lo \
- model/synchronized.lo model/this.lo model/throw.lo \
- model/throwsclause.lo model/try.lo model/type.lo \
- model/typemap.lo model/typevar.lo model/unary.lo model/unit.lo \
- model/value.lo model/variable.lo model/varref.lo \
- model/varstmt.lo model/while.lo model/wildcard.lo
+ model/identifier.lo model/if.lo model/import.lo \
+ model/imodifiable.lo model/init.lo model/instanceof.lo \
+ model/invoke.lo model/label.lo model/literal.lo \
+ model/memberref.lo model/method.lo model/modifier.lo \
+ model/newarray.lo model/new.lo model/null.lo model/package.lo \
+ model/parameters.lo model/primitive.lo model/return.lo \
+ model/stmt.lo model/switch.lo model/synchronized.lo \
+ model/this.lo model/throw.lo model/throwsclause.lo \
+ model/try.lo model/type.lo model/typemap.lo model/typevar.lo \
+ model/unary.lo model/unit.lo model/value.lo model/variable.lo \
+ model/varref.lo model/varstmt.lo model/while.lo \
+ model/wildcard.lo
am__objects_3 = reader/classbytes.lo reader/fdreader.lo \
reader/zereader.lo reader/zebuffer.lo reader/mmapbuffer.lo \
reader/readbuffer.lo reader/source.lo
@@ -324,19 +325,19 @@ model/arraytype.cc model/assert.cc model
model/block.cc model/blockscope.cc model/break.cc model/bytecode.cc \
model/cast.cc model/catch.cc model/class.cc model/classinst.cc \
model/classref.cc model/cond.cc model/constructor.cc model/continue.cc \
-model/declstmt.cc model/do.cc model/empty.cc model/enum.cc \
-model/expr.cc model/exprstmt.cc model/field.cc model/fieldinit.cc \
-model/fieldref.cc model/for.cc model/forenhanced.cc model/fwdtype.cc \
-model/iannotatable.cc model/if.cc model/import.cc model/imodifiable.cc \
-model/init.cc model/instanceof.cc model/invoke.cc model/label.cc \
-model/literal.cc model/memberref.cc model/method.cc model/modifier.cc \
-model/newarray.cc model/new.cc model/null.cc model/package.cc \
-model/parameters.cc model/primitive.cc model/return.cc model/stmt.cc \
-model/switch.cc model/synchronized.cc model/this.cc model/throw.cc \
-model/throwsclause.cc model/try.cc model/type.cc model/typemap.cc \
-model/typevar.cc model/unary.cc model/unit.cc model/value.cc \
-model/variable.cc model/varref.cc model/varstmt.cc model/while.cc \
-model/wildcard.cc
+model/declstmt.cc model/do.cc model/element.cc model/empty.cc \
+model/enum.cc model/expr.cc model/exprstmt.cc model/field.cc \
+model/fieldinit.cc model/fieldref.cc model/for.cc model/forenhanced.cc \
+model/fwdtype.cc model/iannotatable.cc model/identifier.cc model/if.cc \
+model/import.cc model/imodifiable.cc model/init.cc model/instanceof.cc \
+model/invoke.cc model/label.cc model/literal.cc model/memberref.cc \
+model/method.cc model/modifier.cc model/newarray.cc model/new.cc \
+model/null.cc model/package.cc model/parameters.cc model/primitive.cc \
+model/return.cc model/stmt.cc model/switch.cc model/synchronized.cc \
+model/this.cc model/throw.cc model/throwsclause.cc model/try.cc \
+model/type.cc model/typemap.cc model/typevar.cc model/unary.cc \
+model/unit.cc model/value.cc model/variable.cc model/varref.cc \
+model/varstmt.cc model/while.cc model/wildcard.cc
bytecode_sources = bytecode/attribute.cc bytecode/block.cc \
bytecode/bytegen.cc bytecode/classreader.cc bytecode/classwriter.cc \
@@ -492,6 +493,8 @@ model/continue.lo: model/$(am__dirstamp)
model/declstmt.lo: model/$(am__dirstamp) \
model/$(DEPDIR)/$(am__dirstamp)
model/do.lo: model/$(am__dirstamp) model/$(DEPDIR)/$(am__dirstamp)
+model/element.lo: model/$(am__dirstamp) \
+ model/$(DEPDIR)/$(am__dirstamp)
model/empty.lo: model/$(am__dirstamp) model/$(DEPDIR)/$(am__dirstamp)
model/enum.lo: model/$(am__dirstamp) model/$(DEPDIR)/$(am__dirstamp)
model/expr.lo: model/$(am__dirstamp) model/$(DEPDIR)/$(am__dirstamp)
@@ -509,6 +512,8 @@ model/fwdtype.lo: model/$(am__dirstamp)
model/$(DEPDIR)/$(am__dirstamp)
model/iannotatable.lo: model/$(am__dirstamp) \
model/$(DEPDIR)/$(am__dirstamp)
+model/identifier.lo: model/$(am__dirstamp) \
+ model/$(DEPDIR)/$(am__dirstamp)
model/if.lo: model/$(am__dirstamp) model/$(DEPDIR)/$(am__dirstamp)
model/import.lo: model/$(am__dirstamp) model/$(DEPDIR)/$(am__dirstamp)
model/imodifiable.lo: model/$(am__dirstamp) \
@@ -951,6 +956,8 @@ mostlyclean-compile:
-rm -f model/declstmt.lo
-rm -f model/do.$(OBJEXT)
-rm -f model/do.lo
+ -rm -f model/element.$(OBJEXT)
+ -rm -f model/element.lo
-rm -f model/empty.$(OBJEXT)
-rm -f model/empty.lo
-rm -f model/enum.$(OBJEXT)
@@ -973,6 +980,8 @@ mostlyclean-compile:
-rm -f model/fwdtype.lo
-rm -f model/iannotatable.$(OBJEXT)
-rm -f model/iannotatable.lo
+ -rm -f model/identifier.$(OBJEXT)
+ -rm -f model/identifier.lo
-rm -f model/if.$(OBJEXT)
-rm -f model/if.lo
-rm -f model/imodifiable.$(OBJEXT)
@@ -1175,6 +1184,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/continue.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/declstmt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/do.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/element.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/empty.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/enum.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/expr.Plo@am__quote@
@@ -1186,6 +1196,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/forenhanced.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/fwdtype.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/iannotatable.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/identifier.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/if.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/imodifiable.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@model/$(DEPDIR)/import.Plo@am__quote@
Index: ChangeLog
from Ranjit Mathew <rmathew@gcc.gnu.org>
* tree.hh (tree_generator): Dummy implementations of new visitor
methods.
Index: tree.hh
===================================================================
--- tree.hh 2005-10-06 22:30:20.000000000 +0530
+++ tree.hh 2005-10-06 22:30:33.000000000 +0530
@@ -489,6 +489,67 @@ public:
void visit_simple_variable_ref (model_simple_variable_ref *,
const model_variable_decl *);
+
+ void visit_forwarding_type (model_forwarding_type *,
+ const model_type *)
+ {
+ // Nothing.
+ }
+
+ void visit_variable_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_parameter_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_catch_decl (model_variable_decl *,
+ const std::string &,
+ const ref_forwarding_type &,
+ const ref_expression &,
+ bool,
+ bool)
+ {
+ // Nothing.
+ }
+
+ void visit_package (model_package *, const std::list<std::string> &)
+ {
+ // Nothing.
+ }
+
+ void visit_primitive (model_primitive_base *, const char *)
+ {
+ // Nothing.
+ }
+
+ void visit_type (model_type *, const std::string &)
+ {
+ // Nothing.
+ }
+
+ void visit_identifier (model_identifier *, const std::string &)
+ {
+ // Nothing.
+ }
+
+ void visit_element (model_element *)
+ {
+ // Nothing.
+ }
};
#endif // GCC_JAVA_TREE_HH