Author: rolf
Date: 2007-05-13 03:44:54 -0400 (Sun, 13 May 2007)
New Revision: 77305

Modified:
   trunk/mono-basic/vbnc/vbnc/source/ChangeLog
   trunk/mono-basic/vbnc/vbnc/source/General/AssemblyInfo.vb
   trunk/mono-basic/vbnc/vbnc/source/General/Compiler.vb
   trunk/mono-basic/vbnc/vbnc/source/General/Helper.vb
   trunk/mono-basic/vbnc/vbnc/source/General/TypeCache.vb
   trunk/mono-basic/vbnc/vbnc/source/General/TypeManager.vb
   trunk/mono-basic/vbnc/vbnc/source/vbnc.vbproj
Log:
* vbnc.vbproj: Updated.

Modified: trunk/mono-basic/vbnc/vbnc/source/ChangeLog
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/ChangeLog 2007-05-13 06:51:45 UTC (rev 
77304)
+++ trunk/mono-basic/vbnc/vbnc/source/ChangeLog 2007-05-13 07:44:54 UTC (rev 
77305)
@@ -1,3 +1,7 @@
+2007-05-13  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
+       * vbnc.vbproj: Updated.
+
 2007-05-12  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
        * vbnc.vbproj: Updated.

Modified: trunk/mono-basic/vbnc/vbnc/source/General/AssemblyInfo.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/General/AssemblyInfo.vb   2007-05-13 
06:51:45 UTC (rev 77304)
+++ trunk/mono-basic/vbnc/vbnc/source/General/AssemblyInfo.vb   2007-05-13 
07:44:54 UTC (rev 77305)
@@ -49,4 +49,4 @@
 ' You can specify all the values or you can default the Build and Revision 
Numbers 
 ' by using the '*' as shown below:
 
-<Assembly: AssemblyVersion("0.0.0.5420")>
+<Assembly: AssemblyVersion("0.0.0.5449")>

Modified: trunk/mono-basic/vbnc/vbnc/source/General/Compiler.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/General/Compiler.vb       2007-05-13 
06:51:45 UTC (rev 77304)
+++ trunk/mono-basic/vbnc/vbnc/source/General/Compiler.vb       2007-05-13 
07:44:54 UTC (rev 77305)
@@ -389,6 +389,11 @@
         VerifyConsistency(result, "ResolveTypeReferences")
         If result = False Then Return result
 
+        m_TypeCache.InitInternalVBMembers()
+#If ENABLECECIL Then
+        m_CecilTypeCache.InitInternalVBMembers()
+#End If
+
         result = theAss.CreateImplicitMembers AndAlso result
         VerifyConsistency(result, "CreateImplicitMembers")
         If result = False Then Return result
@@ -486,12 +491,6 @@
             'Calculate the output filename
             result = Compile_CalculateOutputFilename() AndAlso result
 
-
-            '#If DEBUG Then
-            '            'Errors before we know the out file name cannot be 
reported.
-            '            Report.XMLFileName = 
CreateTestOutputFilename(m_OutFilename, "messages")
-            '#End If
-
             'Load all the referenced assemblies and load all the types and 
namespaces into the type manager
             m_TypeCache = New TypeCache(Me)
 #If ENABLECECIL Then
@@ -514,8 +513,16 @@
             result = Compile_Parse() AndAlso result
             If Report.Errors > 0 Then GoTo ShowErrors
 
+
             m_TypeManager.LoadCompiledTypes()
 
+            If CommandLine.NoVBRuntimeRef Then
+                m_TypeCache.InitInternalVB()
+#If ENABLECECIL Then
+                m_CecilTypeCache.InitInternalVB()
+#End If
+            End If
+
             'Resolve the code
 #If DEBUG Then
             Report.WriteLine(vbnc.Report.ReportLevels.Debug, "Starting 
Resolve")
@@ -581,8 +588,8 @@
 
 #If ENABLECECIL Then
 
-            Mono.Cecil.AssemblyFactory.SaveAssembly(AssemblyBuilderCecil, 
m_OutFilename & ".cecil.dll")
-            Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug, 
String.Format("Assembly '{0}' saved successfully to '{1}'.", 
AssemblyBuilderCecil.Name.FullName, m_OutFilename & ".cecil.dll"))
+            Mono.Cecil.AssemblyFactory.SaveAssembly(AssemblyBuilderCecil, 
m_OutFilename)
+            Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug, 
String.Format("Assembly '{0}' saved successfully to '{1}'.", 
AssemblyBuilderCecil.Name.FullName, m_OutFilename))
 #End If
 
             SequenceTime(CompilerSequence.End) = DateTime.Now

Modified: trunk/mono-basic/vbnc/vbnc/source/General/Helper.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/General/Helper.vb 2007-05-13 06:51:45 UTC 
(rev 77304)
+++ trunk/mono-basic/vbnc/vbnc/source/General/Helper.vb 2007-05-13 07:44:54 UTC 
(rev 77305)
@@ -990,8 +990,13 @@
         Dim result As Boolean
         If TypeOf type Is TypeDescriptor Then
             Return IsModule(Compiler, DirectCast(type, TypeDescriptor))
+        ElseIf TypeOf Compiler.TypeCache.MS_VB_CS_StandardModuleAttribute Is 
TypeDescriptor Then
+            'We're compiling the vbruntime, so no external type may be a 
module (we know that we're not referencing any external assemblies with modules)
+            Return False
+        ElseIf Compiler.TypeCache.MS_VB_CS_StandardModuleAttribute Is Nothing 
Then
+            Return False
         Else
-            result = type.IsClass AndAlso 
Compiler.TypeCache.MS_VB_CS_StandardModuleAttribute IsNot Nothing AndAlso 
type.IsDefined(Compiler.TypeCache.MS_VB_CS_StandardModuleAttribute, False)
+            result = type.IsClass AndAlso 
type.IsDefined(Compiler.TypeCache.MS_VB_CS_StandardModuleAttribute, False)
             Return result
         End If
     End Function
@@ -1473,6 +1478,16 @@
         Return result
     End Function
 
+#If ENABLECECIL Then
+    Shared Function GetTypeDefinition(ByVal Compiler As Compiler, ByVal Type 
As Type) As Mono.Cecil.TypeReference
+        Dim tD As TypeDescriptor = TryCast(Type, TypeDescriptor)
+        If tD IsNot Nothing Then
+            Return tD.Declaration.CecilType
+        Else
+            Return Compiler.ModuleBuilderCecil.Import(Type)
+        End If
+    End Function
+#End If
     Shared Sub ApplyTypeArguments(ByVal Members As Generic.List(Of 
MemberInfo), ByVal TypeArguments As TypeArgumentList)
         If TypeArguments Is Nothing OrElse TypeArguments.Count = 0 Then Return
 

Modified: trunk/mono-basic/vbnc/vbnc/source/General/TypeCache.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/General/TypeCache.vb      2007-05-13 
06:51:45 UTC (rev 77304)
+++ trunk/mono-basic/vbnc/vbnc/source/General/TypeCache.vb      2007-05-13 
07:44:54 UTC (rev 77305)
@@ -68,6 +68,9 @@
     Shared Function Generate(ByVal Lines As String(), ByVal Cecil As Boolean) 
As String
         Dim variables As New System.Text.StringBuilder
         Dim getters As New System.Text.StringBuilder
+        Dim vbtypes As New System.Text.StringBuilder
+        Dim vbmembers As New System.Text.StringBuilder
+
         'Turns out using public fields instead of private fields with property 
getters is about 10% faster during bootstrapping.
         'Quite possibly because there's quite more code to compile with the 
properties
         Dim publicfields As Boolean = True
@@ -76,6 +79,9 @@
             getters.AppendLine("    Protected Overrides Sub InitInternal ()")
         End If
 
+        vbtypes.AppendLine("    Public Overrides Sub InitInternalVB()")
+        vbmembers.AppendLine("    Public Overrides Sub 
InitInternalVBMembers()")
+
         For Each line As String In Lines
             If line.StartsWith("'") Then Continue For
             If line.Trim = "" Then Continue For
@@ -84,6 +90,8 @@
             Dim name, type, find, parameters As String
             Dim param As Integer = Integer.MaxValue
             Dim noparaminname As Boolean = False
+            Dim isVB As Boolean = False
+            Dim isVBMember As Boolean = False
 
             parameters = Nothing
 
@@ -93,14 +101,22 @@
                     name = 
name.Replace("Microsoft.VisualBasic.CompilerServices.", "MS_VB_CS_")
                     name = name.Replace("Microsoft.VisualBasic.", "MS_VB_")
                     name = name.Replace("""", "").Replace(".", 
"_").Replace("`", "").Replace("+", "_")
-                    If Cecil Then type = "Mono.Cecil.TypeReference" Else type 
= "System.Type"
+                    If Cecil Then type = "Mono.Cecil.TypeDefinition" Else type 
= "System.Type"
                     find = "GetVBType"
                     parameters = splitted(1)
+                    isVB = True
                 Case "type"
                     name = splitted(2).Replace("""", "").Replace(".", 
"_").Replace("`", "").Replace("+", "_")
                     If Cecil Then type = "Mono.Cecil.TypeDefinition" Else type 
= "System.Type"
                     find = "[GetType]"
                     parameters = splitted(1) & ", " & splitted(2)
+#If ENABLECECIL Then
+                    If Cecil AndAlso splitted(2).IndexOf("+"c) > 0 Then
+                        Dim declaringtype As String = splitted(2).Substring(0, 
splitted(2).LastIndexOf("+"c)).Replace(".", "_").Replace("""", "")
+                        Dim nestedtype As String = """" & 
splitted(2).Substring(splitted(2).LastIndexOf("+"c) + 1)
+                        parameters = declaringtype & ", " & nestedtype
+                    End If
+#End If
                 Case "array"
                     name = splitted(1).Replace("""", "").Replace(".", 
"_").Replace("`", "") & "_Array"
                     If Cecil Then type = "Mono.Cecil.TypeReference" Else type 
= "System.Type"
@@ -118,23 +134,27 @@
                     param = 3
                     find = "GetMethod"
                     parameters = splitted(1) & ", " & splitted(2)
+                    isVBMember = splitted(1).StartsWith("MS_")
                 Case "property"
                     name = splitted(1) & "__" & splitted(2).Replace("""", 
"").Replace(".", "_").Replace("`", "")
                     If Cecil Then type = "Mono.Cecil.PropertyDefinition" Else 
type = "System.Reflection.PropertyInfo"
                     param = 3
                     find = "GetProperty"
                     parameters = splitted(1) & ", " & splitted(2)
+                    isVBMember = splitted(1).StartsWith("MS_")
                 Case "field"
                     name = splitted(1) & "__" & splitted(2).Replace("""", 
"").Replace(".", "_").Replace("`", "")
                     If Cecil Then type = "Mono.Cecil.FieldDefinition" Else 
type = "System.Reflection.FieldInfo"
                     find = "GetField"
                     parameters = splitted(1) & ", " & splitted(2)
+                    isVBMember = splitted(1).StartsWith("MS_")
                 Case "ctor"
                     name = splitted(1) & "__ctor"
                     If Cecil Then type = "Mono.Cecil.MethodDefinition" Else 
type = "System.Reflection.ConstructorInfo"
                     param = 2
                     find = "GetConstructor"
                     parameters = splitted(1)
+                    isVBMember = splitted(1).StartsWith("MS_")
                 Case Else
                     Helper.Stop()
                     Throw New NotImplementedException(splitted(0))
@@ -159,8 +179,16 @@
                 variables.AppendLine(String.Format("    Private m_{0} As {1}", 
name, type))
             End If
 
+            Dim text As String
             If publicfields Then
-                getters.AppendLine(String.Format("        {0} = {1}({2})", 
name, find, parameters))
+                text = String.Format("        {0} = {1}({2})", name, find, 
parameters)
+                If isVB Then
+                    vbtypes.AppendLine(text)
+                ElseIf isVBMember Then
+                    vbmembers.AppendLine(text)
+                Else
+                    getters.AppendLine(text)
+                End If
             Else
                 getters.AppendLine(String.Format("    Public ReadOnly Property 
{0} As {1}", name, type))
                 getters.AppendLine(String.Format("        Get"))
@@ -177,7 +205,10 @@
             getters.AppendLine("    End Sub")
         End If
 
-        Return variables.ToString & Environment.NewLine & getters.ToString
+        vbtypes.AppendLine("    End Sub")
+        vbmembers.AppendLine("    End Sub")
+
+        Return variables.ToString & Environment.NewLine & getters.ToString & 
Environment.NewLine & vbtypes.ToString & Environment.NewLine & 
vbmembers.ToString
     End Function
 #End If
 
@@ -205,15 +236,28 @@
     End Function
 
     Friend Function GetMethod(ByVal Type As Type, ByVal Name As String, ByVal 
ParamArray Types() As Type) As MethodInfo
-        Dim result As MethodInfo
+        Dim result As MethodInfo = Nothing
         If Type Is Nothing Then
 #If DEBUG Then
             Compiler.Report.WriteLine("Could not load the method '" & Name & 
"', the specified type was Nothing.")
 #End If
             Return Nothing
         End If
-        result = Type.GetMethod(Name, BindingFlags.Public Or 
BindingFlags.Static Or BindingFlags.Instance Or BindingFlags.ExactBinding Or 
BindingFlags.NonPublic, Nothing, Types, Nothing)
+        Dim tD As TypeDescriptor = TryCast(Type, TypeDescriptor)
+        If tD IsNot Nothing AndAlso False Then
+            Dim members As MethodInfo()
+            members = tD.GetMethods(BindingFlags.Public Or BindingFlags.Static 
Or BindingFlags.Instance Or BindingFlags.ExactBinding Or BindingFlags.NonPublic)
+            For i As Integer = 0 To members.Length - 1
+                If NameResolution.CompareNameOrdinal(members(i).Name, Name) 
Then
+                    Helper.Assert(result Is Nothing)
+                    result = members(i)
+                End If
+            Next
+        Else
+            result = Type.GetMethod(Name, BindingFlags.Public Or 
BindingFlags.Static Or BindingFlags.Instance Or BindingFlags.ExactBinding Or 
BindingFlags.NonPublic, Nothing, Types, Nothing)
+        End If
 
+
 #If DEBUG Then
         If result Is Nothing Then
             Compiler.Report.WriteLine(Report.ReportLevels.Debug, "Could not 
find the method '" & Name & "' on the type '" & Type.FullName)
@@ -232,9 +276,25 @@
 
     Protected Overloads Function [GetType](ByVal Assembly As 
Mono.Cecil.AssemblyDefinition, ByVal FullName As String) As 
Mono.Cecil.TypeDefinition
         If Assembly Is Nothing Then Return Nothing
-        Return Assembly.MainModule.Types.Item(FullName)
+        Dim result As Mono.Cecil.TypeDefinition
+        result = Assembly.MainModule.Types.Item(FullName)
+        If result Is Nothing Then 
Compiler.Report.WriteLine(String.Format("Could not load the type '{0}' from the 
assembly '{1}'", FullName, Assembly.Name.FullName))
+        Return result
     End Function
 
+    Protected Overloads Function [GetType](ByVal Type As 
Mono.Cecil.TypeDefinition, ByVal Name As String) As Mono.Cecil.TypeDefinition
+        If Type Is Nothing Then Return Nothing
+        Dim result As Mono.Cecil.TypeDefinition = Nothing
+        For Each item As Mono.Cecil.TypeDefinition In Type.NestedTypes
+            If NameResolution.CompareNameOrdinal(item.Name, Name) Then
+                result = item
+                Exit For
+            End If
+        Next
+        If result Is Nothing Then 
Compiler.Report.WriteLine(String.Format("Could not load the nested type '{0}' 
from the type '{1}'", Name, Type.FullName))
+        Return result
+    End Function
+
     Protected Function GetByRefType(ByVal Type As Mono.Cecil.TypeDefinition) 
As Mono.Cecil.TypeReference
         Return New Mono.Cecil.ReferenceType(Type)
     End Function
@@ -279,15 +339,18 @@
             Return Nothing
         End If
 
-        result = Type.Methods.GetMethod(Name, Types)
-
+        If Name.StartsWith(".") Then
+            result = 
Type.Constructors.GetConstructor(NameResolution.CompareNameOrdinal(Name, 
".cctor"), Types)
+        Else
+            result = Type.Methods.GetMethod(Name, Types)
+        End If
 #If DEBUG Then
-        If result Is Nothing Then
-            Compiler.Report.WriteLine(Report.ReportLevels.Debug, "Could not 
find the method '" & Name & "' on the type '" & Type.FullName)
-        End If
+            If result Is Nothing Then
+                Compiler.Report.WriteLine(Report.ReportLevels.Debug, "Could 
not find the method '" & Name & "' on the type '" & Type.FullName)
+            End If
 #End If
 
-        Return result
+            Return result
     End Function
 
     Protected Function GetField(ByVal Type As Mono.Cecil.TypeDefinition, ByVal 
Name As String) As Mono.Cecil.FieldDefinition
@@ -311,6 +374,12 @@
 
     Protected MustOverride Sub InitVBNCTypes()
 
+    Public MustOverride Sub InitInternalVB()
+
+    Public Overridable Sub InitInternalVBMembers()
+
+    End Sub
+
 End Class
 
 Public Class TypeCache
@@ -392,6 +461,9 @@
         DelegateUnresolvedType = GetType(DelegateUnresolvedType)
     End Sub
 
+    Protected Overrides Sub Finalize()
+        MyBase.Finalize()
+    End Sub
 End Class
 
 #If ENABLECECIL Then
@@ -834,6 +906,9 @@
         System_Windows_Forms_Application__Run = 
GetMethod(System_Windows_Forms_Application, "Run", System_Windows_Forms_Form)
         System_Delegate__Combine = GetMethod(System_Delegate, "Combine", 
System_Delegate, System_Delegate)
         System_Delegate__Remove = GetMethod(System_Delegate, "Remove", 
System_Delegate, System_Delegate)
+    End Sub
+
+    Public Overrides Sub InitInternalVB()
         MS_VB_CompareMethod = GetVBType("Microsoft.VisualBasic.CompareMethod")
         MS_VB_CS_Conversions = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Conversions")
         MS_VB_CS_ProjectData = 
GetVBType("Microsoft.VisualBasic.CompilerServices.ProjectData")
@@ -843,28 +918,31 @@
         MS_VB_MyGroupCollectionAttribute = 
GetVBType("Microsoft.VisualBasic.MyGroupCollectionAttribute")
         MS_VB_CallType = GetVBType("Microsoft.VisualBasic.CallType")
         MS_VB_Information = GetVBType("Microsoft.VisualBasic.Information")
+        MS_VB_Interaction = GetVBType("Microsoft.VisualBasic.Interaction")
+        MS_VB_CS_Versioned = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Versioned")
+        MS_VB_CS_StandardModuleAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute")
+        MS_VB_CS_Operators = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Operators")
+        MS_VB_CS_ObjectFlowControl = 
GetVBType("Microsoft.VisualBasic.CompilerServices.ObjectFlowControl")
+        MS_VB_CS_Utils = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Utils")
+        MS_VB_CS_OptionCompareAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute")
+        MS_VB_CS_OptionTextAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.OptionTextAttribute")
+        MS_VB_CS_StaticLocalInitFlag = 
GetVBType("Microsoft.VisualBasic.CompilerServices.StaticLocalInitFlag")
+        MS_VB_CS_IncompleteInitialization = 
GetVBType("Microsoft.VisualBasic.CompilerServices.IncompleteInitialization")
+    End Sub
+
+    Public Overrides Sub InitInternalVBMembers()
         MS_VB_Information__IsNumeric = GetMethod(MS_VB_Information, 
"IsNumeric", System_Object)
         MS_VB_Information__SystemTypeName = GetMethod(MS_VB_Information, 
"SystemTypeName", System_String)
         MS_VB_Information__TypeName = GetMethod(MS_VB_Information, "TypeName", 
System_Object)
         MS_VB_Information__VbTypeName = GetMethod(MS_VB_Information, 
"VbTypeName", System_String)
-        MS_VB_Interaction = GetVBType("Microsoft.VisualBasic.Interaction")
         MS_VB_Interaction__CallByName = GetMethod(MS_VB_Interaction, 
"CallByName", System_Object, System_String, MS_VB_CallType, System_Object_Array)
-        MS_VB_CS_Versioned = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Versioned")
         MS_VB_CS_Versioned__IsNumeric = GetMethod(MS_VB_CS_Versioned, 
"IsNumeric", System_Object)
         MS_VB_CS_Versioned__SystemTypeName = GetMethod(MS_VB_CS_Versioned, 
"SystemTypeName", System_String)
         MS_VB_CS_Versioned__TypeName = GetMethod(MS_VB_CS_Versioned, 
"TypeName", System_Object)
         MS_VB_CS_Versioned__VbTypeName = GetMethod(MS_VB_CS_Versioned, 
"VbTypeName", System_String)
         MS_VB_CS_Versioned__CallByName = GetMethod(MS_VB_CS_Versioned, 
"CallByName", System_Object, System_String, MS_VB_CallType, System_Object_Array)
-        MS_VB_CS_StandardModuleAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute")
-        MS_VB_CS_Operators = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Operators")
-        MS_VB_CS_ObjectFlowControl = 
GetVBType("Microsoft.VisualBasic.CompilerServices.ObjectFlowControl")
-        MS_VB_CS_Utils = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Utils")
-        MS_VB_CS_OptionCompareAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute")
-        MS_VB_CS_OptionTextAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.OptionTextAttribute")
-        MS_VB_CS_StaticLocalInitFlag = 
GetVBType("Microsoft.VisualBasic.CompilerServices.StaticLocalInitFlag")
         MS_VB_CS_StaticLocalInitFlag__State = 
GetField(MS_VB_CS_StaticLocalInitFlag, "State")
         MS_VB_CS_StaticLocalInitFlag__ctor = 
GetConstructor(MS_VB_CS_StaticLocalInitFlag)
-        MS_VB_CS_IncompleteInitialization = 
GetVBType("Microsoft.VisualBasic.CompilerServices.IncompleteInitialization")
         MS_VB_CS_IncompleteInitialization__ctor = 
GetConstructor(MS_VB_CS_IncompleteInitialization)
         MS_VB_CS_ProjectData__EndApp = GetMethod(MS_VB_CS_ProjectData, 
"EndApp")
         MS_VB_CS_ProjectData__CreateProjectError_Int32 = 
GetMethod(MS_VB_CS_ProjectData, "CreateProjectError", System_Int32)
@@ -1249,7 +1327,7 @@
         System_Reflection_AssemblyDelaySignAttribute = [GetType](mscorlib, 
"System.Reflection.AssemblyDelaySignAttribute")
         System_Diagnostics_ConditionalAttribute = [GetType](mscorlib, 
"System.Diagnostics.ConditionalAttribute")
         System_Diagnostics_DebuggableAttribute = [GetType](mscorlib, 
"System.Diagnostics.DebuggableAttribute")
-        System_Diagnostics_DebuggableAttribute_DebuggingModes = 
[GetType](mscorlib, "System.Diagnostics.DebuggableAttribute+DebuggingModes")
+        System_Diagnostics_DebuggableAttribute_DebuggingModes = 
[GetType](System_Diagnostics_DebuggableAttribute, "DebuggingModes")
         System_Diagnostics_DebuggableAttribute__ctor_DebuggingModes = 
GetConstructor(System_Diagnostics_DebuggableAttribute, 
System_Diagnostics_DebuggableAttribute_DebuggingModes)
         System_ParamArrayAttribute = [GetType](mscorlib, 
"System.ParamArrayAttribute")
         System_ParamArrayAttribute__ctor = 
GetConstructor(System_ParamArrayAttribute)
@@ -1312,6 +1390,9 @@
         System_Windows_Forms_Application__Run = 
GetMethod(System_Windows_Forms_Application, "Run", System_Windows_Forms_Form)
         System_Delegate__Combine = GetMethod(System_Delegate, "Combine", 
System_Delegate, System_Delegate)
         System_Delegate__Remove = GetMethod(System_Delegate, "Remove", 
System_Delegate, System_Delegate)
+    End Sub
+
+    Public Overrides Sub InitInternalVB()
         MS_VB_CompareMethod = GetVBType("Microsoft.VisualBasic.CompareMethod")
         MS_VB_CS_Conversions = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Conversions")
         MS_VB_CS_ProjectData = 
GetVBType("Microsoft.VisualBasic.CompilerServices.ProjectData")
@@ -1321,28 +1402,31 @@
         MS_VB_MyGroupCollectionAttribute = 
GetVBType("Microsoft.VisualBasic.MyGroupCollectionAttribute")
         MS_VB_CallType = GetVBType("Microsoft.VisualBasic.CallType")
         MS_VB_Information = GetVBType("Microsoft.VisualBasic.Information")
+        MS_VB_Interaction = GetVBType("Microsoft.VisualBasic.Interaction")
+        MS_VB_CS_Versioned = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Versioned")
+        MS_VB_CS_StandardModuleAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute")
+        MS_VB_CS_Operators = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Operators")
+        MS_VB_CS_ObjectFlowControl = 
GetVBType("Microsoft.VisualBasic.CompilerServices.ObjectFlowControl")
+        MS_VB_CS_Utils = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Utils")
+        MS_VB_CS_OptionCompareAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute")
+        MS_VB_CS_OptionTextAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.OptionTextAttribute")
+        MS_VB_CS_StaticLocalInitFlag = 
GetVBType("Microsoft.VisualBasic.CompilerServices.StaticLocalInitFlag")
+        MS_VB_CS_IncompleteInitialization = 
GetVBType("Microsoft.VisualBasic.CompilerServices.IncompleteInitialization")
+    End Sub
+
+    Public Overrides Sub InitInternalVBMembers()
         MS_VB_Information__IsNumeric = GetMethod(MS_VB_Information, 
"IsNumeric", System_Object)
         MS_VB_Information__SystemTypeName = GetMethod(MS_VB_Information, 
"SystemTypeName", System_String)
         MS_VB_Information__TypeName = GetMethod(MS_VB_Information, "TypeName", 
System_Object)
         MS_VB_Information__VbTypeName = GetMethod(MS_VB_Information, 
"VbTypeName", System_String)
-        MS_VB_Interaction = GetVBType("Microsoft.VisualBasic.Interaction")
         MS_VB_Interaction__CallByName = GetMethod(MS_VB_Interaction, 
"CallByName", System_Object, System_String, MS_VB_CallType, System_Object_Array)
-        MS_VB_CS_Versioned = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Versioned")
         MS_VB_CS_Versioned__IsNumeric = GetMethod(MS_VB_CS_Versioned, 
"IsNumeric", System_Object)
         MS_VB_CS_Versioned__SystemTypeName = GetMethod(MS_VB_CS_Versioned, 
"SystemTypeName", System_String)
         MS_VB_CS_Versioned__TypeName = GetMethod(MS_VB_CS_Versioned, 
"TypeName", System_Object)
         MS_VB_CS_Versioned__VbTypeName = GetMethod(MS_VB_CS_Versioned, 
"VbTypeName", System_String)
         MS_VB_CS_Versioned__CallByName = GetMethod(MS_VB_CS_Versioned, 
"CallByName", System_Object, System_String, MS_VB_CallType, System_Object_Array)
-        MS_VB_CS_StandardModuleAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute")
-        MS_VB_CS_Operators = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Operators")
-        MS_VB_CS_ObjectFlowControl = 
GetVBType("Microsoft.VisualBasic.CompilerServices.ObjectFlowControl")
-        MS_VB_CS_Utils = 
GetVBType("Microsoft.VisualBasic.CompilerServices.Utils")
-        MS_VB_CS_OptionCompareAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute")
-        MS_VB_CS_OptionTextAttribute = 
GetVBType("Microsoft.VisualBasic.CompilerServices.OptionTextAttribute")
-        MS_VB_CS_StaticLocalInitFlag = 
GetVBType("Microsoft.VisualBasic.CompilerServices.StaticLocalInitFlag")
         MS_VB_CS_StaticLocalInitFlag__State = 
GetField(MS_VB_CS_StaticLocalInitFlag, "State")
         MS_VB_CS_StaticLocalInitFlag__ctor = 
GetConstructor(MS_VB_CS_StaticLocalInitFlag)
-        MS_VB_CS_IncompleteInitialization = 
GetVBType("Microsoft.VisualBasic.CompilerServices.IncompleteInitialization")
         MS_VB_CS_IncompleteInitialization__ctor = 
GetConstructor(MS_VB_CS_IncompleteInitialization)
         MS_VB_CS_ProjectData__EndApp = GetMethod(MS_VB_CS_ProjectData, 
"EndApp")
         MS_VB_CS_ProjectData__CreateProjectError_Int32 = 
GetMethod(MS_VB_CS_ProjectData, "CreateProjectError", System_Int32)

Modified: trunk/mono-basic/vbnc/vbnc/source/General/TypeManager.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/General/TypeManager.vb    2007-05-13 
06:51:45 UTC (rev 77304)
+++ trunk/mono-basic/vbnc/vbnc/source/General/TypeManager.vb    2007-05-13 
07:44:54 UTC (rev 77305)
@@ -279,6 +279,14 @@
     Function LoadReferenced() As Boolean
         Dim result As Boolean = True
         result = LoadReferencedAssemblies() AndAlso result
+
+        If Compiler.CommandLine.NoVBRuntimeRef = False Then
+            Compiler.TypeCache.InitInternalVB()
+#If ENABLECECIL Then
+            Compiler.CecilTypeCache.InitInternalVB()
+#End If
+        End If
+
         result = LoadReferencedTypes() AndAlso result
 
 #If EXTENDEDDEBUG Then

Modified: trunk/mono-basic/vbnc/vbnc/source/vbnc.vbproj
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/vbnc.vbproj       2007-05-13 06:51:45 UTC 
(rev 77304)
+++ trunk/mono-basic/vbnc/vbnc/source/vbnc.vbproj       2007-05-13 07:44:54 UTC 
(rev 77305)
@@ -69,7 +69,7 @@
     <RunCodeAnalysis>false</RunCodeAnalysis>
     
<CodeAnalysisRules>-Microsoft.Design#CA1012;-Microsoft.Design#CA2210;-Microsoft.Design#CA1040;-Microsoft.Design#CA1005;-Microsoft.Design#CA1020;-Microsoft.Design#CA1021;-Microsoft.Design#CA1010;-Microsoft.Design#CA1011;-Microsoft.Design#CA1009;-Microsoft.Design#CA1050;-Microsoft.Design#CA1026;-Microsoft.Design#CA1019;-Microsoft.Design#CA1031;-Microsoft.Design#CA1047;-Microsoft.Design#CA1000;-Microsoft.Design#CA1048;-Microsoft.Design#CA1051;-Microsoft.Design#CA1002;-Microsoft.Design#CA1061;-Microsoft.Design#CA1006;-Microsoft.Design#CA1046;-Microsoft.Design#CA1045;-Microsoft.Design#CA1038;-Microsoft.Design#CA1008;-Microsoft.Design#CA1028;-Microsoft.Design#CA1004;-Microsoft.Design#CA1035;-Microsoft.Design#CA1063;-Microsoft.Design#CA1032;-Microsoft.Design#CA1023;-Microsoft.Design#CA1033;-Microsoft.Design#CA1039;-Microsoft.Design#CA1016;-Microsoft.Design#CA1014;-Microsoft.Design#CA1017;-Microsoft.Design#CA1018;-Microsoft.Design#CA1027;-Microsoft.Design#CA1059;-Microsoft.Desig
 
n#CA1060;-Microsoft.Design#CA1034;-Microsoft.Design#CA1013;-Microsoft.Design#CA1036;-Microsoft.Design#CA1044;-Microsoft.Design#CA1041;-Microsoft.Design#CA1025;-Microsoft.Design#CA1052;-Microsoft.Design#CA1053;-Microsoft.Design#CA1057;-Microsoft.Design#CA1058;-Microsoft.Design#CA1001;-Microsoft.Design#CA1049;-Microsoft.Design#CA1054;-Microsoft.Design#CA1056;-Microsoft.Design#CA1055;-Microsoft.Design#CA1030;-Microsoft.Design#CA1003;-Microsoft.Design#CA1007;-Microsoft.Design#CA1043;-Microsoft.Design#CA1024;-Microsoft.Design#CA1062;-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302;-Microsoft.Globalization#CA1303;-Microsoft.Globalization#CA1306;-Microsoft.Globalization#CA1304;-Microsoft.Globalization#CA1305;-Microsoft.Globalization#CA1300;-Microsoft.Interoperability#CA1403;-Microsoft.Interoperability#CA1406;-Microsoft.Interoperability#CA1413;-Microsoft.Interoperability#CA1402;-Microsoft.Interoperability#CA1407;-Microsoft.Interoperability#CA1404;-Microsoft.Interopera
 
bility#CA1410;-Microsoft.Interoperability#CA1411;-Microsoft.Interoperability#CA1405;-Microsoft.Interoperability#CA1409;-Microsoft.Interoperability#CA1415;-Microsoft.Interoperability#CA1408;-Microsoft.Interoperability#CA1414;-Microsoft.Interoperability#CA1412;-Microsoft.Interoperability#CA1400;-Microsoft.Interoperability#CA1401;-Microsoft.Maintainability#CA1502;-Microsoft.Maintainability#CA1501;-Microsoft.Maintainability#CA1500;-Microsoft.Mobility#CA1600;-Microsoft.Mobility#CA1601;-Microsoft.Naming#CA1718;-Microsoft.Naming#CA1720;-Microsoft.Naming#CA1700;-Microsoft.Naming#CA1712;-Microsoft.Naming#CA1713;-Microsoft.Naming#CA1709;-Microsoft.Naming#CA1708;-Microsoft.Naming#CA1715;-Microsoft.Naming#CA1710;-Microsoft.Naming#CA1707;-Microsoft.Naming#CA1722;-Microsoft.Naming#CA1711;-Microsoft.Naming#CA1716;-Microsoft.Naming#CA1705;-Microsoft.Naming#CA1725;-Microsoft.Naming#CA1719;-Microsoft.Naming#CA1721;-Microsoft.Naming#CA1706;-Microsoft.Naming#CA1724;-Microsoft.Naming#CA1726;-Mic
 
rosoft.Performance#CA1809;-Microsoft.Performance#CA1811;-Microsoft.Performance#CA1812;-Microsoft.Performance#CA1807;-Microsoft.Performance#CA1813;-Microsoft.Performance#CA1823;-Microsoft.Performance#CA1816;-Microsoft.Performance#CA1817;-Microsoft.Performance#CA1800;-Microsoft.Performance#CA1818;-Microsoft.Performance#CA1805;-Microsoft.Performance#CA1810;-Microsoft.Performance#CA1822;-Microsoft.Performance#CA1815;-Microsoft.Performance#CA1814;-Microsoft.Performance#CA1819;-Microsoft.Performance#CA1804;-Microsoft.Performance#CA1820;-Microsoft.Performance#CA1802;-Microsoft.Portability#CA1901;-Microsoft.Portability#CA1900;-Microsoft.Reliability#CA2000;-Microsoft.Reliability#CA2002;-Microsoft.Reliability#CA2003;-Microsoft.Reliability#CA2004;-Microsoft.Reliability#CA2006;-Microsoft.Security#CA2116;-Microsoft.Security#CA2117;-Microsoft.Security#CA2105;-Microsoft.Security#CA2115;-Microsoft.Security#CA2104;-Microsoft.Security#CA2122;-Microsoft.Security#CA2114;-Microsoft.Security#CA21
 
23;-Microsoft.Security#CA2111;-Microsoft.Security#CA2108;-Microsoft.Security#CA2107;-Microsoft.Security#CA2103;-Microsoft.Security#CA2100;-Microsoft.Security#CA2118;-Microsoft.Security#CA2109;-Microsoft.Security#CA2119;-Microsoft.Security#CA2106;-Microsoft.Security#CA2112;-Microsoft.Security#CA2110;-Microsoft.Security#CA2120;-Microsoft.Security#CA2101;-Microsoft.Security#CA2121;-Microsoft.Security#CA2126;-Microsoft.Security#CA2124;-Microsoft.Usage#CA2209;-Microsoft.Usage#CA2236;-Microsoft.Usage#CA2227;-Microsoft.Usage#CA2213;-Microsoft.Usage#CA2216;-Microsoft.Usage#CA2215;-Microsoft.Usage#CA2214;-Microsoft.Usage#CA2222;-Microsoft.Usage#CA2202;-Microsoft.Usage#CA1806;-Microsoft.Usage#CA2217;-Microsoft.Usage#CA2212;-Microsoft.Usage#CA2219;-Microsoft.Usage#CA2201;-Microsoft.Usage#CA2228;-Microsoft.Usage#CA2221;-Microsoft.Usage#CA2220;-Microsoft.Usage#CA2240;-Microsoft.Usage#CA2229;-Microsoft.Usage#CA2238;-Microsoft.Usage#CA2207;-Microsoft.Usage#CA2208;-Microsoft.Usage#CA2235;-M
 
icrosoft.Usage#CA2237;-Microsoft.Usage#CA2232;-Microsoft.Usage#CA2223;-Microsoft.Usage#CA2211;-Microsoft.Usage#CA2233;-Microsoft.Usage#CA2225;-Microsoft.Usage#CA2226;-Microsoft.Usage#CA2231;-Microsoft.Usage#CA2224;-Microsoft.Usage#CA2218;-Microsoft.Usage#CA2234;-Microsoft.Usage#CA2241;-Microsoft.Usage#CA2239;-Microsoft.Usage#CA2200;-Microsoft.Usage#CA1801;-Microsoft.Usage#CA2205;-Microsoft.Usage#CA2230</CodeAnalysisRules>
     <UseVSHostingProcess>false</UseVSHostingProcess>
-    
<DefineConstants>GENERATOR,DEVGENERATOR,ENABLECECIL=true,DEBUGREFLECTION=false</DefineConstants>
+    
<DefineConstants>GENERATOR,DEVGENERATOR,ENABLECECIL=false,DEBUGREFLECTION=false</DefineConstants>
     <OutputType>Exe</OutputType>
     <AssemblyName>vbnc</AssemblyName>
     <RootNamespace>vbnc</RootNamespace>

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to