Rework gc descriptor to include size information in more cases.
[mono.git] / mcs / mcs / driver.cs
index 4e9ea35fbd3179c63602216a6b5028e832dc9a94..ef3467e45d3e2e52b35650e6624f14f9652dae99 100644 (file)
@@ -9,6 +9,7 @@
 //
 // Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)
 // Copyright 2004, 2005, 2006, 2007, 2008 Novell, Inc
+// Copyright 2011 Xamarin Inc
 //
 
 using System;
@@ -82,7 +83,7 @@ namespace Mono.CSharp
                        }
                }
 
-               void Parse (CompilationSourceFile file, ModuleContainer module)
+               public void Parse (CompilationSourceFile file, ModuleContainer module)
                {
                        Stream input;
 
@@ -110,7 +111,7 @@ namespace Mono.CSharp
                
                public void Parse (SeekableStreamReader reader, CompilationSourceFile file, ModuleContainer module)
                {
-                       file.NamespaceContainer = new NamespaceEntry (module, null, file, null);
+                       file.NamespaceContainer = new NamespaceContainer (null, module, null, file);
 
                        CSharpParser parser = new CSharpParser (reader, file);
                        parser.parse ();
@@ -220,11 +221,11 @@ namespace Mono.CSharp
                        if (Report.Errors > 0)
                                return false;
 
-                       if (settings.TokenizeOnly || settings.ParseOnly)
+                       if (settings.TokenizeOnly || settings.ParseOnly) {
+                               tr.StopTotal ();
+                               tr.ShowStats ();
                                return true;
-
-                       if (RootContext.ToplevelTypes.NamespaceEntry != null)
-                               throw new InternalErrorException ("who set it?");
+                       }
 
                        var output_file = settings.OutputFile;
                        string output_file_name;
@@ -269,7 +270,7 @@ namespace Mono.CSharp
                        references_loader.LoadReferences (module);
 
                        tr.Start (TimeReporter.TimerType.PredefinedTypesInit);
-                       if (!ctx.BuildinTypes.CheckDefinitions (module))
+                       if (!ctx.BuiltinTypes.CheckDefinitions (module))
                                return false;
 
                        tr.Stop (TimeReporter.TimerType.PredefinedTypesInit);
@@ -279,13 +280,13 @@ namespace Mono.CSharp
                        var assembly = new AssemblyDefinitionDynamic (module, output_file_name, output_file);
                        module.SetDeclaringAssembly (assembly);
 
-                       var importer = new ReflectionImporter (module, ctx.BuildinTypes);
+                       var importer = new ReflectionImporter (module, ctx.BuiltinTypes);
                        assembly.Importer = importer;
 
                        var loader = new DynamicLoader (importer, ctx);
                        loader.LoadReferences (module);
 
-                       if (!ctx.BuildinTypes.CheckDefinitions (module))
+                       if (!ctx.BuiltinTypes.CheckDefinitions (module))
                                return false;
 
                        if (!assembly.Create (AppDomain.CurrentDomain, AssemblyBuilderAccess.Save))
@@ -299,7 +300,7 @@ namespace Mono.CSharp
 
                        tr.Start (TimeReporter.TimerType.UsingResolve);
                        foreach (var source_file in ctx.SourceFiles) {
-                               source_file.NamespaceContainer.Resolve ();
+                               source_file.NamespaceContainer.Define ();
                        }
                        tr.Stop (TimeReporter.TimerType.UsingResolve);
 
@@ -310,10 +311,10 @@ namespace Mono.CSharp
                        if (Report.Errors > 0)
                                return false;
 
-                       if (settings.Documentation != null &&
-                               !settings.Documentation.OutputDocComment (
-                                       output_file, Report))
-                               return false;
+                       if (settings.DocumentationFile != null) {
+                               var doc = new DocumentationBuilder (module);
+                               doc.OutputDocComment (output_file, settings.DocumentationFile);
+                       }
 
                        assembly.Resolve ();