Author: marek
Date: 2006-03-12 18:16:05 -0500 (Sun, 12 Mar 2006)
New Revision: 57884
Modified:
trunk/mcs/gmcs/anonymous.cs
trunk/mcs/gmcs/attribute.cs
trunk/mcs/gmcs/class.cs
trunk/mcs/gmcs/codegen.cs
trunk/mcs/gmcs/const.cs
trunk/mcs/gmcs/decl.cs
trunk/mcs/gmcs/delegate.cs
trunk/mcs/gmcs/enum.cs
trunk/mcs/gmcs/generic.cs
trunk/mcs/gmcs/iterators.cs
trunk/mcs/gmcs/tree.cs
Log:
manually synchronized with 56802
Modified: trunk/mcs/gmcs/anonymous.cs
===================================================================
--- trunk/mcs/gmcs/anonymous.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/anonymous.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -403,7 +403,7 @@
//ILGenerator ig = builder.GetILGenerator ();
- aec = new EmitContext (
+ aec = new EmitContext (ec.ResolveContext,
ec.TypeContainer, ec.DeclContainer, loc, null,
invoke_mb.ReturnType,
/* REVIEW */ (ec.InIterator ?
Modifiers.METHOD_YIELDS : 0) |
Modified: trunk/mcs/gmcs/attribute.cs
===================================================================
--- trunk/mcs/gmcs/attribute.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/attribute.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -184,7 +184,7 @@
DeclSpace container =
owner.ResolveContext.DeclContainer;
if (owner is TypeParameter)
container = ((TypeParameter)owner).DeclSpace;
- EmitContext ec = new EmitContext (container, container,
+ EmitContext ec = new EmitContext (owner.ResolveContext,
container, container,
Location, null, null,
container.ModFlags, false);
//
@@ -404,7 +404,7 @@
// First process positional arguments
//
- EmitContext ec = new EmitContext
(owner.ResolveContext.DeclContainer, owner.ResolveContext.DeclContainer,
+ EmitContext ec = new EmitContext (owner.ResolveContext,
owner.ResolveContext.DeclContainer, owner.ResolveContext.DeclContainer,
Location, null, null,
owner.ResolveContext.DeclContainer.ModFlags, false);
int i;
Modified: trunk/mcs/gmcs/class.cs
===================================================================
--- trunk/mcs/gmcs/class.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/class.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -1237,7 +1237,7 @@
ec = null;
foreach (ClassPart part in Parts) {
part.TypeBuilder = TypeBuilder;
- part.ec = new EmitContext (part,
Mono.CSharp.Location.Null, null, null, ModFlags);
+ part.ec = new EmitContext (this, part,
Mono.CSharp.Location.Null, null, null, ModFlags);
part.ec.ContainerType = TypeBuilder;
}
} else {
@@ -1247,7 +1247,7 @@
// we already have the `ec', so we don't want
to create a new one.
//
if (ec == null)
- ec = new EmitContext (this,
Mono.CSharp.Location.Null, null, null, ModFlags);
+ ec = new EmitContext (this, this,
Mono.CSharp.Location.Null, null, null, ModFlags);
ec.ContainerType = TypeBuilder;
}
@@ -4370,7 +4370,7 @@
public EmitContext CreateEmitContext (TypeContainer tc,
ILGenerator ig)
{
- EmitContext ec = new EmitContext (
+ EmitContext ec = new EmitContext (this,
tc, ds, Location, ig, ReturnType, ModFlags,
false);
Iterator iterator = tc as Iterator;
@@ -4889,7 +4889,7 @@
public EmitContext CreateEmitContext (TypeContainer tc,
ILGenerator ig)
{
ILGenerator ig_ = ConstructorBuilder.GetILGenerator ();
- return new EmitContext (Parent, Location, ig_, null,
ModFlags, true);
+ return new EmitContext (this, Parent, Location, ig_,
null, ModFlags, true);
}
public bool IsExcluded()
@@ -6523,7 +6523,7 @@
public override EmitContext CreateEmitContext
(TypeContainer tc,
ILGenerator ig)
{
- return new EmitContext (
+ return new EmitContext (method,
tc, method.ds, method.Location, ig,
ReturnType,
method.ModFlags, false);
}
@@ -6637,7 +6637,7 @@
return false;
}
- ec = new EmitContext (Parent, Location, null,
MemberType, ModFlags);
+ ec = new EmitContext (this, Parent, Location, null,
MemberType, ModFlags);
return true;
}
Modified: trunk/mcs/gmcs/codegen.cs
===================================================================
--- trunk/mcs/gmcs/codegen.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/codegen.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -403,9 +403,10 @@
CurrentIterator, capture_context,
loc);
}
- public EmitContext (DeclSpace parent, DeclSpace ds, Location l,
ILGenerator ig,
+ public EmitContext (IResolveContext rc, DeclSpace parent,
DeclSpace ds, Location l, ILGenerator ig,
Type return_type, int code_flags, bool
is_constructor)
{
+ this.ResolveContext = rc;
this.ig = ig;
TypeContainer = parent;
@@ -428,10 +429,7 @@
if (parent != null){
// Can only be null for the ResolveType
contexts.
ContainerType = parent.TypeBuilder;
- if (parent.UnsafeContext)
- InUnsafe = true;
- else
- InUnsafe = (code_flags &
Modifiers.UNSAFE) != 0;
+ InUnsafe = rc.IsInUnsafeScope;
}
loc = l;
@@ -439,15 +437,15 @@
ReturnType = null;
}
- public EmitContext (TypeContainer tc, Location l, ILGenerator
ig,
+ public EmitContext (IResolveContext rc, TypeContainer tc,
Location l, ILGenerator ig,
Type return_type, int code_flags, bool
is_constructor)
- : this (tc, tc, l, ig, return_type, code_flags,
is_constructor)
+ : this (rc, tc, tc, l, ig, return_type, code_flags,
is_constructor)
{
}
- public EmitContext (TypeContainer tc, Location l, ILGenerator
ig,
+ public EmitContext (IResolveContext rc, TypeContainer tc,
Location l, ILGenerator ig,
Type return_type, int code_flags)
- : this (tc, tc, l, ig, return_type, code_flags, false)
+ : this (rc, tc, tc, l, ig, return_type, code_flags,
false)
{
}
Modified: trunk/mcs/gmcs/const.cs
===================================================================
--- trunk/mcs/gmcs/const.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/const.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -135,7 +135,7 @@
}
in_transit = true;
- EmitContext ec = new EmitContext (Parent, Location,
null, MemberType, ModFlags);
+ EmitContext ec = new EmitContext (this, Parent,
Location, null, MemberType, ModFlags);
value = initializer.ResolveAsConstant (ec, this);
in_transit = false;
Modified: trunk/mcs/gmcs/decl.cs
===================================================================
--- trunk/mcs/gmcs/decl.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/decl.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -893,7 +893,7 @@
//
// However, if Parent ==
RootContext.Tree.Types, its NamespaceEntry will be null.
//
- type_resolve_ec = new EmitContext
(Parent, this, Location.Null, null, null, ModFlags, false);
+ type_resolve_ec = new EmitContext
(this, Parent, this, Location.Null, null, null, ModFlags, false);
}
return type_resolve_ec;
}
Modified: trunk/mcs/gmcs/delegate.cs
===================================================================
--- trunk/mcs/gmcs/delegate.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/delegate.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -78,7 +78,7 @@
if (TypeBuilder != null)
return TypeBuilder;
- ec = new EmitContext (this, this, Location, null, null,
ModFlags, false);
+ ec = new EmitContext (this, this, this, Location, null,
null, ModFlags, false);
if (IsGeneric) {
foreach (TypeParameter type_param in
TypeParameters)
Modified: trunk/mcs/gmcs/enum.cs
===================================================================
--- trunk/mcs/gmcs/enum.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/enum.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -43,7 +43,7 @@
this.ValueExpr = expr;
this.prev_member = prev_member;
- ec = new EmitContext (parent_enum, parent_enum,
Location, null, null, ModFlags, false);
+ ec = new EmitContext (this, parent_enum, parent_enum,
Location, null, null, ModFlags, false);
ec.InEnumContext = true;
}
Modified: trunk/mcs/gmcs/generic.cs
===================================================================
--- trunk/mcs/gmcs/generic.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/generic.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -1737,7 +1737,7 @@
public override bool Define ()
{
- ec = new EmitContext (this, this, Location, null, null,
ModFlags, false);
+ ec = new EmitContext (this, this, this, Location, null,
null, ModFlags, false);
for (int i = 0; i < TypeParameters.Length; i++)
if (!TypeParameters [i].Resolve (this))
Modified: trunk/mcs/gmcs/iterators.cs
===================================================================
--- trunk/mcs/gmcs/iterators.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/iterators.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -387,7 +387,7 @@
public bool DefineIterator ()
{
- ec = new EmitContext (this, Location, null, null,
ModFlags);
+ ec = new EmitContext (this, this, Location, null, null,
ModFlags);
ec.CurrentAnonymousMethod = move_next_method;
ec.InIterator = true;
Modified: trunk/mcs/gmcs/tree.cs
===================================================================
--- trunk/mcs/gmcs/tree.cs 2006-03-12 23:12:13 UTC (rev 57883)
+++ trunk/mcs/gmcs/tree.cs 2006-03-12 23:16:05 UTC (rev 57884)
@@ -76,7 +76,7 @@
public RootTypes ()
: base (null, null, MemberName.Null, null, Kind.Root)
{
- ec = new EmitContext (null, this, Location.Null, null,
null, 0, false);
+ ec = new EmitContext (this, null, this, Location.Null,
null, null, 0, false);
}
public override PendingImplementation GetPendingImplementations
()
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches