//
Encoding encoding;
- readonly CompilerContext ctx;
+ internal readonly CompilerContext ctx;
static readonly char[] argument_value_separator = new char [] { ';', ',' };
public static Driver Create (string[] args, bool require_files, ReportPrinter printer)
{
- Driver d = new Driver (new CompilerContext (new Report (printer)));
+ Driver d = new Driver (new CompilerContext (new ReflectionMetaImporter (), new Report (printer)));
if (!d.ParseArguments (args, require_files))
return null;
// Extern aliased refs require special handling
if (alias == null)
- GlobalRootNamespace.Instance.AddAssemblyReference (a);
+ ctx.GlobalRootNamespace.AddAssemblyReference (a);
else
- GlobalRootNamespace.Instance.DefineRootNamespace (alias, a, ctx);
+ ctx.GlobalRootNamespace.DefineRootNamespace (alias, a, ctx);
} catch (BadImageFormatException f) {
// .NET 2.0 throws this if we try to load a module without an assembly manifest ...
}
}
- GlobalRootNamespace.Instance.AddModuleReference (m);
+ ctx.GlobalRootNamespace.AddModuleReference (m);
} catch (BadImageFormatException f) {
Error9 ("module", f.FileName, f.FusionLog);
foreach (var entry in external_aliases)
LoadAssembly (entry.Value, entry.Key, false);
- GlobalRootNamespace.Instance.ComputeNamespaces (ctx);
+ ctx.GlobalRootNamespace.ComputeNamespaces (ctx);
}
static string [] LoadArgs (string file)
set_method.Invoke (CodeGen.Assembly.Builder, BindingFlags.Default, null, new object[]{true}, null);
}
- GlobalRootNamespace.Instance.AddModuleReference (RootContext.ToplevelTypes.Builder);
+ ctx.GlobalRootNamespace.AddModuleReference (RootContext.ToplevelTypes.Builder);
//
// Load assemblies required
if (timestamps)
ShowTime ("Loading references");
- Import.Initialize ();
+ ctx.MetaImporter.Initialize ();
LoadReferences ();
if (modules.Count > 0) {
if (timestamps)
ShowTime ("Closing types");
- RootContext.CloseTypes ();
+ RootContext.CloseTypes (ctx);
PEFileKinds k = PEFileKinds.ConsoleApplication;
RootContext.Reset (full_flag);
TypeManager.Reset ();
- PredefinedAttributes.Reset ();
ArrayContainer.Reset ();
ReferenceContainer.Reset ();
PointerContainer.Reset ();
Parameter.Reset ();
- GlobalRootNamespace.Reset ();
Unary.Reset ();
Binary.Reset ();
ConstantFold.Reset ();
Linq.QueryBlock.TransparentParameter.Reset ();
Convert.Reset ();
TypeInfo.Reset ();
- DynamicExpressionStatement.Reset ();
}
}
}