[kaffe] CVS kaffe-extras (guilhem): KJC fix for inner classes.

Kaffe CVS cvs-commits at kaffe.org
Wed Jul 7 02:53:28 PDT 2004


PatchSet 38 
Date: 2004/07/07 08:36:39
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
KJC fix for inner classes.

        * kjc/CBinaryClass.java: Fixed circular reference of an inner class
        to itself so the right symbol can be solved when invoking a class
        of the same name in that inner class.

Members: 
	patches/kjc-kaffe.diff:1.5->1.6 

Index: kaffe-extras/patches/kjc-kaffe.diff
diff -u kaffe-extras/patches/kjc-kaffe.diff:1.5 kaffe-extras/patches/kjc-kaffe.diff:1.6
--- kaffe-extras/patches/kjc-kaffe.diff:1.5	Sun May 23 18:40:42 2004
+++ kaffe-extras/patches/kjc-kaffe.diff	Wed Jul  7 08:36:39 2004
@@ -1,7 +1,13 @@
 diff -N ChangeLog
 --- /dev/null	1 Jan 1970 00:00:00 -0000
-+++ ChangeLog	23 May 2004 18:38:09 -0000	1.4
-@@ -0,0 +1,27 @@
++++ ChangeLog	7 Jul 2004 08:26:03 -0000	1.5
+@@ -0,0 +1,33 @@
++2004-07-07 Guilhem Lavaux <guilhem at kaffe.org>
++
++	* kjc/CBinaryClass.java: Fixed circular reference of an inner class
++	to itself so the right symbol can be solved when invoking a class
++	of the same name in that inner class.
++
 +2004-05-23  Guilhem Lavaux <guilhem at kaffe.org>
 +
 +	* bytecode/ssa/Node.java
@@ -834,7 +840,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.5 2004/05/23 18:40:42 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.6 2004/07/07 08:36:39 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -945,7 +951,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.5 2004/05/23 18:40:42 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.6 2004/07/07 08:36:39 guilhem Exp $
 + */
 +
 +// Import the necessary classes
@@ -2418,7 +2424,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.5 2004/05/23 18:40:42 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.6 2004/07/07 08:36:39 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -4638,7 +4644,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.5 2004/05/23 18:40:42 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.6 2004/07/07 08:36:39 guilhem Exp $
 + */
 +
 +package at.dms.ksm
@@ -4790,7 +4796,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.5 2004/05/23 18:40:42 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.6 2004/07/07 08:36:39 guilhem Exp $
 + */
 +
 +prefix Ksm
@@ -8036,7 +8042,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.5 2004/05/23 18:40:42 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.6 2004/07/07 08:36:39 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -8123,7 +8129,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.5 2004/05/23 18:40:42 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.6 2004/07/07 08:36:39 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -8315,7 +8321,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.5 2004/05/23 18:40:42 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.6 2004/07/07 08:36:39 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -8424,7 +8430,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.5 2004/05/23 18:40:42 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.6 2004/07/07 08:36:39 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -8490,7 +8496,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.5 2004/05/23 18:40:42 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.6 2004/07/07 08:36:39 guilhem Exp $
 + */
 +
 +aaload ......... :
@@ -12051,9 +12057,9 @@
 +  protected BitSet[] interferenceVarColors;
 +  protected QVar[] variables;
  }
-diff -u -r1.1.1.1 ControlFlowGraph.java
+diff -u -r1.1.1.1 -r1.2
 --- bytecode/ssa/ControlFlowGraph.java	6 Apr 2004 16:59:32 -0000	1.1.1.1
-+++ bytecode/ssa/ControlFlowGraph.java	23 May 2004 18:38:37 -0000
++++ bytecode/ssa/ControlFlowGraph.java	10 Apr 2004 10:28:33 -0000	1.2
 @@ -43,6 +43,7 @@
  import java.util.LinkedList;
  import java.util.Map;
@@ -32838,6 +32844,40 @@
  	return true;
        } else {
  	return false;
+diff -u -r1.1.1.1 -r1.2
+--- kjc/CBinaryClass.java	6 Apr 2004 16:59:22 -0000	1.1.1.1
++++ kjc/CBinaryClass.java	7 Jul 2004 08:26:03 -0000	1.2
+@@ -20,6 +20,7 @@
+ 
+ package at.dms.kjc;
+ 
++import java.util.ArrayList;
+ import java.util.Hashtable;
+ import java.util.Enumeration;
+ 
+@@ -163,12 +164,19 @@
+    */
+   protected CReferenceType[] loadInnerClasses(TypeFactory factory, InnerClassInfo[] inners) {
+     if (inners != null) {
+-      CReferenceType[]      innerClasses = new CReferenceType[inners.length];
++      // Here we need to remove the reference of this class to itself as an
++      // inner class. As we cannot have another class of the same name in the
++      // inner class tree, it is simple: just remove the class of the same
++      // name. As we want to support some compilers which would not put that
++      // special field, use an ArrayList.
++      ArrayList innerClasses = new ArrayList();
+ 
+       for (int i = 0; i < inners.length; i++) {
+-	innerClasses[i] = factory.createType(inners[i].getQualifiedName(), true);
++	if (isNested() && getQualifiedName().equals(inners[i].getQualifiedName()))
++	  continue;
++	innerClasses.add(factory.createType(inners[i].getQualifiedName(), true));
+       }
+-      return innerClasses;
++      return (CReferenceType[])innerClasses.toArray(new CReferenceType[innerClasses.size()]);
+     } else {
+       return CReferenceType.EMPTY;
+     }
 diff -u -r1.1.1.1 -r1.2
 --- kjc/CBinaryField.java	6 Apr 2004 16:59:24 -0000	1.1.1.1
 +++ kjc/CBinaryField.java	6 Apr 2004 17:26:10 -0000	1.2



More information about the kaffe mailing list