+2009-08-12 Marek Safar <marek.safar@gmail.com>
+
+ * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
+ class.cs: Removed unused parameters and methods.
+
2009-08-11 Marek Safar <marek.safar@gmail.com>
* generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
}
}
- //
- // Emits the instance field initializers
- //
- public bool EmitFieldInitializers (EmitContext ec)
- {
- if (partial_parts != null) {
- foreach (TypeContainer part in partial_parts)
- part.EmitFieldInitializers (ec);
- }
-
- ArrayList fields;
-
- if (ec.IsStatic){
- fields = initialized_static_fields;
- } else {
- fields = initialized_fields;
- }
-
- if (fields == null)
- return true;
-
- foreach (FieldInitializer f in fields) {
- f.EmitStatement (ec);
- }
- return true;
- }
-
public override string DocComment {
get {
return comment;
else if (Parent != null)
e = Parent.LookupNamespaceOrType (name, loc, ignore_cs0104);
else
- e = NamespaceEntry.LookupNamespaceOrType (this, name, loc, ignore_cs0104);
+ e = NamespaceEntry.LookupNamespaceOrType (name, loc, ignore_cs0104);
if (errors == Report.Errors)
Cache [name] = e;
//
if (type == null) {
Namespace ns = GlobalRootNamespace.Instance.GetNamespace (ns_name, false);
- FullNamedExpression fne = ns.Lookup (null, name, loc);
+ FullNamedExpression fne = ns.Lookup (name, loc);
if (fne != null)
type = fne.Type;
}
//
// Start a new concat expression using converted expression
//
- return new StringConcat (ec, b.loc, b.left, b.right).Resolve (ec);
+ return new StringConcat (b.loc, b.left, b.right).Resolve (ec);
}
}
public class StringConcat : Expression {
Arguments arguments;
- public StringConcat (EmitContext ec, Location loc, Expression left, Expression right)
+ public StringConcat (Location loc, Expression left, Expression right)
{
this.loc = loc;
type = TypeManager.string_type;
eclass = ExprClass.Value;
arguments = new Arguments (2);
- Append (ec, left);
- Append (ec, right);
+ Append (left);
+ Append (right);
}
public override Expression CreateExpressionTree (EmitContext ec)
return this;
}
- public void Append (EmitContext ec, Expression operand)
+ public void Append (Expression operand)
{
//
// Constant folding
Namespace ns = expr_resolved as Namespace;
if (ns != null) {
- FullNamedExpression retval = ns.Lookup (ec.DeclContainer, LookupIdentifier, loc);
+ FullNamedExpression retval = ns.Lookup (LookupIdentifier, loc);
if (retval == null)
- ns.Error_NamespaceDoesNotExist (ec.DeclContainer, loc, LookupIdentifier);
+ ns.Error_NamespaceDoesNotExist (loc, LookupIdentifier);
else if (targs != null)
retval = new GenericTypeExpr (retval.Type, targs, loc).ResolveAsTypeStep (ec, false);
Namespace ns = expr_resolved as Namespace;
if (ns != null) {
- FullNamedExpression retval = ns.Lookup (rc.DeclContainer, LookupIdentifier, loc);
+ FullNamedExpression retval = ns.Lookup (LookupIdentifier, loc);
if (retval == null && !silent)
- ns.Error_NamespaceDoesNotExist (rc.DeclContainer, loc, LookupIdentifier);
+ ns.Error_NamespaceDoesNotExist (loc, LookupIdentifier);
else if (targs != null)
retval = new GenericTypeExpr (retval.Type, targs, loc).ResolveAsTypeStep (rc, silent);
retval.AddAssemblyReference (assembly);
}
- public override void Error_NamespaceDoesNotExist(DeclSpace ds, Location loc, string name)
+ public override void Error_NamespaceDoesNotExist(Location loc, string name)
{
Report.Error (400, loc, "The type or namespace name `{0}' could not be found in the global namespace (are you missing an assembly reference?)",
name);
return this;
}
- public virtual void Error_NamespaceDoesNotExist (DeclSpace ds, Location loc, string name)
+ public virtual void Error_NamespaceDoesNotExist (Location loc, string name)
{
if (name.IndexOf ('`') > 0) {
- FullNamedExpression retval = Lookup (ds, SimpleName.RemoveGenericArity (name), loc);
+ FullNamedExpression retval = Lookup (SimpleName.RemoveGenericArity (name), loc);
if (retval != null) {
Error_TypeArgumentsCannotBeUsed (retval, loc);
return;
return null;
}
- public FullNamedExpression Lookup (DeclSpace ds, string name, Location loc)
+ public FullNamedExpression Lookup (string name, Location loc)
{
if (namespaces.Contains (name))
return (Namespace) namespaces [name];
return parent.LookupExtensionMethod (extensionType, currentClass, name, loc);
}
- public FullNamedExpression LookupNamespaceOrType (DeclSpace ds, string name, Location loc, bool ignore_cs0104)
+ public FullNamedExpression LookupNamespaceOrType (string name, Location loc, bool ignore_cs0104)
{
// Precondition: Only simple names (no dots) will be looked up with this function.
FullNamedExpression resolved = null;
for (NamespaceEntry curr_ns = this; curr_ns != null; curr_ns = curr_ns.ImplicitParent) {
- if ((resolved = curr_ns.Lookup (ds, name, loc, ignore_cs0104)) != null)
+ if ((resolved = curr_ns.Lookup (name, loc, ignore_cs0104)) != null)
break;
}
return resolved;
return null;
}
- private FullNamedExpression Lookup (DeclSpace ds, string name, Location loc, bool ignore_cs0104)
+ private FullNamedExpression Lookup (string name, Location loc, bool ignore_cs0104)
{
//
// Check whether it's in the namespace.
//
- FullNamedExpression fne = ns.Lookup (ds, name, loc);
+ FullNamedExpression fne = ns.Lookup (name, loc);
//
// Check aliases.
//
FullNamedExpression match = null;
foreach (Namespace using_ns in GetUsingTable ()) {
- match = using_ns.Lookup (ds, name, loc);
+ match = using_ns.Lookup (name, loc);
if (match == null || !(match is TypeExpr))
continue;
if (fne != null) {
public static Type CoreLookupType (string ns_name, string name, Kind type_kind, bool required)
{
Namespace ns = GlobalRootNamespace.Instance.GetNamespace (ns_name, true);
- Expression expr = ns.Lookup (RootContext.ToplevelTypes, name, Location.Null);
+ Expression expr = ns.Lookup (name, Location.Null);
if (expr == null) {
if (required) {