Files
mercury/java/runtime/PseudoTypeInfo.java
Fergus Henderson c7f6612d9e Bug fixes and code simplifications in the RTTI handling
Estimated hours taken: 4
Branches: main

Bug fixes and code simplifications in the RTTI handling
for the Java back-end.

compiler/rtti.m:
	For Java, map all the different C representations for TypeInfos
	to a single Java type "java.runtime.TypeInfo_Struct".
	Likewise map all the different C representations for type class
	constraints to a single Java type "java.runtime.TypeInfo_Struct".

java/runtime/FA_PseudoTypeInfo_Struct1.java:
java/runtime/FA_PseudoTypeInfo_Struct2.java:
java/runtime/FA_TypeInfo_Struct1.java:
java/runtime/FA_TypeInfo_Struct2.java:
java/runtime/VA_PseudoTypeInfo_Struct0.java:
java/runtime/VA_PseudoTypeInfo_Struct1.java:
java/runtime/VA_PseudoTypeInfo_Struct2.java:
java/runtime/VA_PseudoTypeInfo_Struct3.java:
java/runtime/VA_PseudoTypeInfo_Struct4.java:
java/runtime/VA_PseudoTypeInfo_Struct8.java:
java/runtime/TypeclassInfo.java:
	Deleted these stub files, since they should no longer be needed.

java/runtime/TypeInfo_Struct.java:
	Add two new constructors, corresponding to the constructors for
	the deleted FA_* and VA_*.java files.

java/runtime/PseudoTypeInfo.java:
	Add some comments.  Make the nullary constructor protected,
	to ensure that it is only used by derived classes, since it
	is only intended to be used for TypeInfo_Struct.
2004-02-19 09:37:21 +00:00

29 lines
1.0 KiB
Java

//
// Copyright (C) 2001-2004 The University of Melbourne.
// This file may only be copied under the terms of the GNU Library General
// Public License - see the file COPYING.LIB in the Mercury distribution.
//
package mercury.runtime;
// A PseudoTypeInfo represents a possibly non-ground type.
// There are three possible cases:
//
// - Unbound type variables are represented by directly constructing
// a PseudoTypeInfo with the variable number.
//
// - Ground types with arity zero may be represented as TypeCtorInfo_Struct,
// which extends PseudoTypeInfo, and uses the protected constructor
// which sets variable_number to -1. This is a slightly optimized
// version of the case below.
//
// - Any other types are represented as TypeInfo_Struct,
// which extends PseudoTypeInfo, and uses the protected constructor
// which sets variable_number to -1.
//
public class PseudoTypeInfo {
public int variable_number;
public PseudoTypeInfo(int n) { variable_number = n; }
protected PseudoTypeInfo() { variable_number = -1; }
}