[gcjx] Patch: cleanup for capture conversion
Tom Tromey
tromey@redhat.com
Mon Oct 24 22:15:00 GMT 2005
I'm checking this in on the gcjx branch.
There is some old code in gcjx that claims to be about 'capture
conversion', but which really has nothing to do with it. I don't
know what I was thinking when I wrote this really.
This just removes the old code in preparation for writing something
correct.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* model/typemap.cc (capture_conversion_p): Removed.
* model/class.hh (model_class::can_capture_p): Removed.
* model/wildcard.hh (model_wildcard::can_capture_p): Removed.
* model/typemap.hh (model_type_map::capture_conversion_p):
Removed.
* model/classinst.cc (capture_conversion_p): Removed.
* model/classinst.hh (model_class_instance::capture_conversion_p):
Removed.
* conversions.cc (widening_reference_conversion): Don't call
capture_conversion_p.
Index: conversions.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/Attic/conversions.cc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 conversions.cc
--- conversions.cc 13 Jan 2005 03:18:33 -0000 1.1.2.1
+++ conversions.cc 24 Oct 2005 21:55:06 -0000
@@ -1,6 +1,6 @@
// Conversion and promotion rules.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -251,11 +251,7 @@
}
else
{
- model_class_instance *toki
- = assert_cast<model_class_instance *> (tok);
- model_class_instance *iteri
- = assert_cast<model_class_instance *> (iter);
- result = toki->capture_conversion_p (iteri);
+ // FIXME: this is wrong.
}
// If we ended up here, we're done.
break;
Index: model/class.hh
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/class.hh,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 class.hh
--- model/class.hh 18 Oct 2005 22:16:55 -0000 1.1.2.7
+++ model/class.hh 24 Oct 2005 21:55:07 -0000
@@ -683,14 +683,6 @@
/// Handles pushing parents as needed.
void push_on_scope (resolution_scope *);
- /// Return true if this class is compatible with the argument
- /// according to capture conversion. This is used to check a single
- /// parameter for capture conversion.
- virtual bool can_capture_p (model_class *other)
- {
- return this == other;
- }
-
static_result is_static_scope () const
{
return static_context_p () ? STATIC_CONTEXT : NOT_STATIC_CONTEXT;
Index: model/classinst.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/classinst.cc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 classinst.cc
--- model/classinst.cc 18 Oct 2005 22:16:55 -0000 1.1.2.3
+++ model/classinst.cc 24 Oct 2005 21:55:07 -0000
@@ -102,12 +102,6 @@
return any_changed ? parent->create_instance (request, new_params) : this;
}
-bool
-model_class_instance::capture_conversion_p (model_class_instance *other)
-{
- return type_map.capture_conversion_p (other->type_map);
-}
-
std::string
model_class_instance::get_signature_map_fragment ()
{
Index: model/classinst.hh
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/classinst.hh,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 classinst.hh
--- model/classinst.hh 18 Oct 2005 22:16:55 -0000 1.1.2.3
+++ model/classinst.hh 24 Oct 2005 21:55:07 -0000
@@ -75,11 +75,6 @@
return parent;
}
- /// Return true if the argument can be converted to this type via
- /// capture conversion. This differs from can_capture_p in that
- /// this method iterates over the parameters.
- bool capture_conversion_p (model_class_instance *);
-
void visit (visitor *);
};
Index: model/typemap.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/typemap.cc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 typemap.cc
--- model/typemap.cc 13 Jan 2005 03:18:36 -0000 1.1.2.1
+++ model/typemap.cc 24 Oct 2005 21:55:07 -0000
@@ -1,6 +1,6 @@
// Map type variables to types or other type variables.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -46,21 +46,3 @@
return NULL;
return (*i).second;
}
-
-bool
-model_type_map::capture_conversion_p (const model_type_map &other)
-{
- assert (typemap.size () == other.typemap.size ());
-
- for (map_type::const_iterator i = typemap.begin (); i != typemap.end (); ++i)
- {
- model_type_variable *var = (*i).first;
- model_class *to = (*i).second;
- map_type::const_iterator oi = other.typemap.find (var);
- assert (oi != other.typemap.end ());
- if (! to->can_capture_p ((*oi).second))
- return false;
- }
-
- return true;
-}
Index: model/typemap.hh
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/typemap.hh,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 typemap.hh
--- model/typemap.hh 13 Jan 2005 03:18:36 -0000 1.1.2.1
+++ model/typemap.hh 24 Oct 2005 21:55:07 -0000
@@ -1,6 +1,6 @@
// Map type variables to types or other type variables.
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -57,8 +57,6 @@
/// Return true if this type map is equivalent to another type map.
bool operator== (const model_type_map &) const;
- bool capture_conversion_p (const model_type_map &);
-
bool empty_p () const
{
return typemap.empty ();
Index: model/wildcard.hh
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/wildcard.hh,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 wildcard.hh
--- model/wildcard.hh 18 Oct 2005 22:16:55 -0000 1.1.2.3
+++ model/wildcard.hh 24 Oct 2005 21:55:07 -0000
@@ -87,11 +87,6 @@
bool assignable_from_p (model_type *);
- bool can_capture_p (model_class *other)
- {
- return assignable_from_p (other);
- }
-
std::string get_pretty_name () const
{
return name;
More information about the Java-patches
mailing list