Author: marek
Date: 2008-02-12 08:46:30 -0500 (Tue, 12 Feb 2008)
New Revision: 95496
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/Makefile
trunk/mcs/mcs/anonymous.cs
trunk/mcs/mcs/class.cs
trunk/mcs/mcs/codegen.cs
trunk/mcs/mcs/doc.cs
trunk/mcs/mcs/ecore.cs
trunk/mcs/mcs/expression.cs
trunk/mcs/mcs/parameter.cs
trunk/mcs/mcs/report.cs
trunk/mcs/mcs/statement.cs
trunk/mcs/mcs/typemanager.cs
Log:
2008-02-12 Marek Safar <[EMAIL PROTECTED]>
* Makefile: Fixed `qh' target to work on all machines.
* report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
anonymous.cs,
expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type
IsSubclassOf
and HasElementType with TypeManager implementation.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/ChangeLog 2008-02-12 13:46:30 UTC (rev 95496)
@@ -1,3 +1,11 @@
+2008-02-12 Marek Safar <[EMAIL PROTECTED]>
+
+ * Makefile: Fixed `qh' target to work on all machines.
+
+ * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
anonymous.cs,
+ expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type
IsSubclassOf
+ and HasElementType with TypeManager implementation.
+
2008-02-08 Marek Safar <[EMAIL PROTECTED]>
A fix for bugs #325134, #359749
Modified: trunk/mcs/mcs/Makefile
===================================================================
--- trunk/mcs/mcs/Makefile 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/Makefile 2008-02-12 13:46:30 UTC (rev 95496)
@@ -135,4 +135,5 @@
$(RUNTIME) $(RUNTIME_FLAGS) --profile=$(PROFILER) $(PROGRAM)
$(USE_MCS_FLAGS) -target:exe -out:mcs2.exe $(BUILT_SOURCES) @$(response)
qh:
- MONO_PATH="../class/lib/net_2_0_bootstrap:$MONO_PATH"
/cvs/mono/runtime/mono-wrapper ../class/lib/net_2_0_bootstrap/gmcs.exe
/codepage:65001 -d:GMCS_SOURCE -d:NET_1_1 -d:NET_2_0 -debug -target:exe
-out:gmcs.exe gcs-parser.cs @gmcs.exe.sources
+
MONO_PATH="../class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
$(RUNTIME) $(RUNTIME_FLAGS) ../class/lib/net_2_0_bootstrap/gmcs.exe
/codepage:65001 -d:GMCS_SOURCE -d:NET_1_1 -d:NET_2_0 -debug -target:exe
-out:gmcs.exe gcs-parser.cs @gmcs.exe.sources
+
Modified: trunk/mcs/mcs/anonymous.cs
===================================================================
--- trunk/mcs/mcs/anonymous.cs 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/anonymous.cs 2008-02-12 13:46:30 UTC (rev 95496)
@@ -1289,7 +1289,7 @@
for (int i = 0; i < Parameters.Count; ++i) {
Type itype = d_params.Types [i];
if (!TypeManager.IsGenericParameter (itype)) {
- if (!itype.HasElementType)
+ if (!TypeManager.HasElementType (itype))
continue;
if (!TypeManager.IsGenericParameter
(itype.GetElementType ()))
Modified: trunk/mcs/mcs/class.cs
===================================================================
--- trunk/mcs/mcs/class.cs 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/class.cs 2008-02-12 13:46:30 UTC (rev 95496)
@@ -2852,7 +2852,7 @@
public override void ApplyAttributeBuilder (Attribute a,
CustomAttributeBuilder cb)
{
- if (a.Type.IsSubclassOf
(TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
+ if (TypeManager.IsSubclassOf (a.Type,
TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
if (declarative_security == null)
declarative_security = new
ListDictionary ();
@@ -2968,14 +2968,13 @@
public override void ApplyAttributeBuilder(Attribute a,
CustomAttributeBuilder cb)
{
if (a.Type == TypeManager.attribute_usage_type) {
- if (BaseType != TypeManager.attribute_type &&
!BaseType.IsSubclassOf (TypeManager.attribute_type) &&
+ if (!TypeManager.IsAttributeType (BaseType) &&
TypeBuilder.FullName !=
"System.Attribute") {
Report.Error (641, a.Location,
"Attribute `{0}' is only valid on classes derived from System.Attribute",
a.GetSignatureForError ());
}
}
- if (a.Type == TypeManager.conditional_attribute_type &&
- !(BaseType == TypeManager.attribute_type ||
BaseType.IsSubclassOf (TypeManager.attribute_type))) {
+ if (a.Type == TypeManager.conditional_attribute_type &&
!TypeManager.IsAttributeType (BaseType)) {
Report.Error (1689, a.Location, "Attribute
`System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute
classes");
return;
}
@@ -3978,7 +3977,7 @@
is_external_implementation = true;
}
- if (a.Type.IsSubclassOf
(TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
+ if (TypeManager.IsSubclassOf (a.Type,
TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
if (declarative_security == null)
declarative_security = new
ListDictionary ();
a.ExtractSecurityPermissionSet
(declarative_security);
@@ -4814,7 +4813,7 @@
public override void ApplyAttributeBuilder (Attribute a,
CustomAttributeBuilder cb)
{
- if (a.Type.IsSubclassOf
(TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
+ if (TypeManager.IsSubclassOf (a.Type,
TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
if (declarative_security == null) {
declarative_security = new
ListDictionary ();
}
@@ -5070,7 +5069,7 @@
if (al.Count > 2)
MemberCache.VerifyClsParameterConflict
(al, this, ConstructorBuilder);
- if (Parent.TypeBuilder.IsSubclassOf
(TypeManager.attribute_type)) {
+ if (TypeManager.IsSubclassOf
(Parent.TypeBuilder, TypeManager.attribute_type)) {
foreach (Type param in ParameterTypes) {
if (param.IsArray) {
return true;
@@ -5702,7 +5701,7 @@
return;
}
- if (a.Type.IsSubclassOf
(TypeManager.security_attr_type)) {
+ if (TypeManager.IsSubclassOf (a.Type,
TypeManager.security_attr_type)) {
a.Error_InvalidSecurityParent ();
return;
}
@@ -6251,7 +6250,7 @@
return;
}
- if (a.Type.IsSubclassOf
(TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
+ if (TypeManager.IsSubclassOf (a.Type,
TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
if (declarative_security == null)
declarative_security = new
ListDictionary ();
a.ExtractSecurityPermissionSet
(declarative_security);
@@ -6686,7 +6685,7 @@
public override void ApplyAttributeBuilder (Attribute a,
CustomAttributeBuilder cb)
{
- if (a.Type.IsSubclassOf
(TypeManager.security_attr_type)) {
+ if (TypeManager.IsSubclassOf (a.Type,
TypeManager.security_attr_type)) {
a.Error_InvalidSecurityParent ();
return;
}
@@ -7545,7 +7544,7 @@
public override void ApplyAttributeBuilder (Attribute a,
CustomAttributeBuilder cb)
{
- if (a.Type.IsSubclassOf
(TypeManager.security_attr_type)) {
+ if (TypeManager.IsSubclassOf (a.Type,
TypeManager.security_attr_type)) {
a.Error_InvalidSecurityParent ();
return;
}
Modified: trunk/mcs/mcs/codegen.cs
===================================================================
--- trunk/mcs/mcs/codegen.cs 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/codegen.cs 2008-02-12 13:46:30 UTC (rev 95496)
@@ -1353,7 +1353,7 @@
public override void ApplyAttributeBuilder (Attribute a,
CustomAttributeBuilder customBuilder)
{
- if (a.Type.IsSubclassOf
(TypeManager.security_attr_type) && a.CheckSecurityActionValidity (true)) {
+ if (TypeManager.IsSubclassOf (a.Type,
TypeManager.security_attr_type) && a.CheckSecurityActionValidity (true)) {
if (declarative_security == null)
declarative_security = new
ListDictionary ();
Modified: trunk/mcs/mcs/doc.cs
===================================================================
--- trunk/mcs/mcs/doc.cs 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/doc.cs 2008-02-12 13:46:30 UTC (rev 95496)
@@ -292,37 +292,37 @@
{
switch (identifier) {
case "int":
- return typeof (int);
+ return TypeManager.int32_type;
case "uint":
- return typeof (uint);
+ return TypeManager.uint32_type;
case "short":
- return typeof (short);
+ return TypeManager.short_type;;
case "ushort":
- return typeof (ushort);
+ return TypeManager.ushort_type;
case "long":
- return typeof (long);
+ return TypeManager.int64_type;
case "ulong":
- return typeof (ulong);
+ return TypeManager.uint64_type;;
case "float":
- return typeof (float);
+ return TypeManager.float_type;;
case "double":
- return typeof (double);
+ return TypeManager.double_type;
case "char":
- return typeof (char);
+ return TypeManager.char_type;;
case "decimal":
- return typeof (decimal);
+ return TypeManager.decimal_type;;
case "byte":
- return typeof (byte);
+ return TypeManager.byte_type;;
case "sbyte":
- return typeof (sbyte);
+ return TypeManager.sbyte_type;;
case "object":
- return typeof (object);
+ return TypeManager.object_type;;
case "bool":
- return typeof (bool);
+ return TypeManager.bool_type;;
case "string":
- return typeof (string);
+ return TypeManager.string_type;;
case "void":
- return typeof (void);
+ return TypeManager.void_type;;
}
FullNamedExpression e = ds.LookupNamespaceOrType
(identifier, mc.Location, false);
if (e != null) {
@@ -711,7 +711,7 @@
Type type = FindDocumentedType (mc, name, ds, cref);
if (type != null
// delegate must not be referenced with args
- && (!type.IsSubclassOf (typeof
(System.Delegate))
+ && (!TypeManager.IsDelegateType (type)
|| parameter_types == null)) {
string result = GetSignatureForDoc (type)
+ (brace_pos < 0 ? String.Empty :
signature.Substring (brace_pos));
Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/ecore.cs 2008-02-12 13:46:30 UTC (rev 95496)
@@ -4675,7 +4675,7 @@
}
if (right_side == EmptyExpression.OutAccess &&
- !IsStatic && !(InstanceExpression is This) &&
DeclaringType.IsSubclassOf (TypeManager.mbr_type)) {
+ !IsStatic && !(InstanceExpression is This) &&
TypeManager.IsSubclassOf (DeclaringType, TypeManager.mbr_type)) {
Report.SymbolRelatedToPreviousError
(DeclaringType);
Report.Warning (197, 1, loc,
"Passing `{0}' as ref or out or
taking its address may cause a runtime exception because it is a field of a
marshal-by-reference class",
@@ -4687,7 +4687,7 @@
public override void CheckMarshalByRefAccess (EmitContext ec)
{
- if (!IsStatic && Type.IsValueType &&
!(InstanceExpression is This) && DeclaringType.IsSubclassOf
(TypeManager.mbr_type)) {
+ if (!IsStatic && Type.IsValueType &&
!(InstanceExpression is This) && TypeManager.IsSubclassOf (DeclaringType,
TypeManager.mbr_type)) {
Report.SymbolRelatedToPreviousError
(DeclaringType);
Report.Warning (1690, 1, loc, "Cannot call
methods, properties, or indexers on `{0}' because it is a value type member of
a marshal-by-reference class",
GetSignatureForError ());
@@ -5406,7 +5406,7 @@
//
if (must_do_cs1540_check && InstanceExpression !=
EmptyExpression.Null &&
InstanceExpression.Type != ec.ContainerType &&
- ec.ContainerType.IsSubclassOf
(InstanceExpression.Type)) {
+ TypeManager.IsSubclassOf (ec.ContainerType,
InstanceExpression.Type)) {
Report.SymbolRelatedToPreviousError (EventInfo);
ErrorIsInaccesible (loc,
TypeManager.CSharpSignature (EventInfo));
return false;
Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/expression.cs 2008-02-12 13:46:30 UTC (rev 95496)
@@ -867,7 +867,7 @@
(t == TypeManager.int64_type) ||
(t == TypeManager.uint64_type) ||
(t == TypeManager.char_type) ||
- (t.IsSubclassOf (TypeManager.enum_type)) ||
+ (TypeManager.IsSubclassOf (t,
TypeManager.enum_type)) ||
(t == TypeManager.float_type) ||
(t == TypeManager.double_type) ||
(t.IsPointer && t != TypeManager.void_ptr_type);
@@ -1829,7 +1829,7 @@
static bool EqualsNullIsReferenceEquals (Type t)
{
return t == TypeManager.object_type || t ==
TypeManager.string_type ||
- t == TypeManager.delegate_type ||
t.IsSubclassOf (TypeManager.delegate_type);
+ t == TypeManager.delegate_type ||
TypeManager.IsDelegateType (t);
}
static void Warning_UnintendedReferenceComparison (Location
loc, string side, Type type)
Modified: trunk/mcs/mcs/parameter.cs
===================================================================
--- trunk/mcs/mcs/parameter.cs 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/parameter.cs 2008-02-12 13:46:30 UTC (rev 95496)
@@ -40,7 +40,7 @@
return;
}
- if (a.Type.IsSubclassOf
(TypeManager.security_attr_type)) {
+ if (TypeManager.IsSubclassOf (a.Type,
TypeManager.security_attr_type)) {
a.Error_InvalidSecurityParent ();
return;
}
Modified: trunk/mcs/mcs/report.cs
===================================================================
--- trunk/mcs/mcs/report.cs 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/report.cs 2008-02-12 13:46:30 UTC (rev 95496)
@@ -700,7 +700,7 @@
if (type is TypeBuilder) {
DeclSpace temp_ds = TypeManager.LookupDeclSpace
(type);
SymbolRelatedToPreviousError (temp_ds.Location,
TypeManager.CSharpName (type));
- } else if (type.HasElementType) {
+ } else if (TypeManager.HasElementType (type)) {
SymbolRelatedToPreviousError
(type.GetElementType ());
} else {
SymbolRelatedToPreviousError
(type.Assembly.Location, TypeManager.CSharpName (type));
Modified: trunk/mcs/mcs/statement.cs
===================================================================
--- trunk/mcs/mcs/statement.cs 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/statement.cs 2008-02-12 13:46:30 UTC (rev 95496)
@@ -3061,7 +3061,7 @@
t == TypeManager.char_type ||
t == TypeManager.string_type ||
t == TypeManager.bool_type ||
- t.IsSubclassOf (TypeManager.enum_type))
+ TypeManager.IsSubclassOf (t, TypeManager.enum_type))
return expr;
if (allowed_types == null){
@@ -4280,7 +4280,7 @@
type = te.Type;
- if (type != TypeManager.exception_type
&& !type.IsSubclassOf (TypeManager.exception_type)){
+ if (type != TypeManager.exception_type
&& !TypeManager.IsSubclassOf (type, TypeManager.exception_type)){
Error (155, "The type caught or
thrown must be derived from System.Exception");
return false;
}
@@ -4370,7 +4370,7 @@
Type resolved_type = c.CatchType;
for (int ii = 0; ii < last_index; ++ii) {
- if (resolved_type == prev_catches [ii]
|| resolved_type.IsSubclassOf (prev_catches [ii])) {
+ if (resolved_type == prev_catches [ii]
|| TypeManager.IsSubclassOf (resolved_type, prev_catches [ii])) {
Report.Error (160, c.loc, "A
previous catch clause already catches all exceptions of this or a super type
`{0}'", prev_catches [ii].FullName);
return false;
}
Modified: trunk/mcs/mcs/typemanager.cs
===================================================================
--- trunk/mcs/mcs/typemanager.cs 2008-02-12 12:19:06 UTC (rev 95495)
+++ trunk/mcs/mcs/typemanager.cs 2008-02-12 13:46:30 UTC (rev 95496)
@@ -1599,11 +1599,11 @@
return false;
#endif
+ if (t == TypeManager.delegate_type)
+ return false;
+
t = DropGenericTypeArguments (t);
- if (t.IsSubclassOf (TypeManager.delegate_type))
- return true;
- else
- return false;
+ return IsSubclassOf (t, TypeManager.delegate_type);
}
public static bool IsEnumType (Type t)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches