Author: rolf
Date: 2006-09-11 20:17:10 -0400 (Mon, 11 Sep 2006)
New Revision: 65265
Added:
trunk/vbnc/vbnc/tests/CompileTime/DirectCast1.vb
trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.rsp
trunk/vbnc/vbnc/tests/CompileTime2/ConstructorInitialization6.vb
trunk/vbnc/vbnc/tests/CompileTime2/ConstructorInitialization7.vb
trunk/vbnc/vbnc/tests/CompileTime2/FirstLinuxProgram.vb
trunk/vbnc/vbnc/tests/FailsIncorrectly/
trunk/vbnc/vbnc/tests/FailsIncorrectly/NoOutDir1.rsp
trunk/vbnc/vbnc/tests/FailsIncorrectly/NoOutDir1.vb
trunk/vbnc/vbnc/tests/FailsIncorrectly/readme.txt
Removed:
trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.response
Modified:
trunk/vbnc/changelog.txt
trunk/vbnc/progress.txt
trunk/vbnc/rt/source/AssemblyInfo.vb
trunk/vbnc/rt/source/Test.vb
trunk/vbnc/vbnc/source/Descriptors/TypeDescriptor.vb
trunk/vbnc/vbnc/source/Emit/EmitStack.vb
trunk/vbnc/vbnc/source/Expressions/Conversions/DirectCastExpression.vb
trunk/vbnc/vbnc/source/Expressions/InvocationOrIndexExpression.vb
trunk/vbnc/vbnc/source/Expressions/SimpleNameExpression.vb
trunk/vbnc/vbnc/source/General/AssemblyInfo.vb
trunk/vbnc/vbnc/source/General/Compiler.vb
trunk/vbnc/vbnc/source/General/Helper.vb
trunk/vbnc/vbnc/source/General/Scanner.vb
trunk/vbnc/vbnc/source/General/TypeManager.vb
trunk/vbnc/vbnc/source/Members/MemberImplementsClause.vb
trunk/vbnc/vbnc/source/Members/Parameter.vb
trunk/vbnc/vbnc/source/Parser/Parser.vb
trunk/vbnc/vbnc/source/TypeDeclarations/AssemblyDeclaration.vb
trunk/vbnc/vbnc/source/TypeDeclarations/ModuleDeclaration.vb
trunk/vbnc/vbnc/source/TypeDeclarations/TypeDeclaration.vb
trunk/vbnc/vbnc/source/Types/TypeNameResolutionInfo.vb
trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.vb
trunk/vbnc/vbnc/tests/VBRunTime/Microsoft.VisualBasic.files.rsp
Log:
2006-09-12 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* A few bugs made the vb runtime regress, they are now fixed.
* Implemented special handling of AscW when compiling with /novbruntime
(thanks to Korn?\195?\169l P?\195?\161l)
* Reduced the debugging output of the compiler.
* Fixed: crash if /out was specified without a directory (only
filename).
Modified: trunk/vbnc/changelog.txt
===================================================================
--- trunk/vbnc/changelog.txt 2006-09-11 23:05:38 UTC (rev 65264)
+++ trunk/vbnc/changelog.txt 2006-09-12 00:17:10 UTC (rev 65265)
@@ -1,3 +1,13 @@
+2006-09-12 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+ * A few bugs made the vb runtime regress, they are now fixed.
+ * Implemented special handling of AscW when compiling with /novbruntime
(thanks to Kornél Pál)
+ * Reduced the debugging output of the compiler.
+ * Fixed: crash if /out was specified without a directory (only
filename).
+
+2006-09-06 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+ * Changed a few methods to make them work without hacks.
+ * Implemented two helper functions to check if the compiler is running
on mono or on MS (Helper.IsOnMS and Helper.IsOnMono).
+
2006-06-07 Kornél Pál <[EMAIL PROTECTED]>
* Decode source files using UTF-8 when they can be decoded using UTF-8.
Modified: trunk/vbnc/progress.txt
===================================================================
--- trunk/vbnc/progress.txt 2006-09-11 23:05:38 UTC (rev 65264)
+++ trunk/vbnc/progress.txt 2006-09-12 00:17:10 UTC (rev 65265)
@@ -1,3 +1,9 @@
+2006-09-10:
+# of Tests: 1926
+# of Tests (Successful): 1264 = 65,6%
+# of Tests (Failed): 662 = 34,4%
+# of Tests (NotRun): 0 = 0,0%
+
2006-08-09:
# of Tests: 10323
# of Tests (Successful): 7835 = 75,9%
Modified: trunk/vbnc/rt/source/AssemblyInfo.vb
===================================================================
--- trunk/vbnc/rt/source/AssemblyInfo.vb 2006-09-11 23:05:38 UTC (rev
65264)
+++ trunk/vbnc/rt/source/AssemblyInfo.vb 2006-09-12 00:17:10 UTC (rev
65265)
@@ -50,5 +50,5 @@
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
-<Assembly: AssemblyVersion("0.0.0.216")>
+<Assembly: AssemblyVersion("0.0.0.217")>
<Assembly: AssemblyFileVersion("0.0.0.1")>
Modified: trunk/vbnc/rt/source/Test.vb
===================================================================
--- trunk/vbnc/rt/source/Test.vb 2006-09-11 23:05:38 UTC (rev 65264)
+++ trunk/vbnc/rt/source/Test.vb 2006-09-12 00:17:10 UTC (rev 65265)
@@ -85,6 +85,7 @@
Public Const DefaultOutputPath As String = "test output\"
Private m_Target As String
+ Private m_NoConfig As Boolean
Private m_LastRun As Date
@@ -434,9 +435,6 @@
Initialize()
- 'Compile code using UTF-8 by default
- result.Add("/codepage:65001")
-
'First option is always the /out: argument.
Const OutArgument As String = "/out:{0}"
If ForVBC Then
@@ -460,6 +458,10 @@
If m_ResponseFile <> "" Then result.Add("@" & m_ResponseFile)
End If
+ If m_NoConfig Then
+ result.Add("/noconfig")
+ End If
+
Return result.ToArray()
End Function
@@ -483,6 +485,8 @@
Sub Initialize()
Dim rsp As String
+ Dim contents As String
+
rsp = IO.Path.Combine(m_BasePath, Name) & ".response"
If IO.File.Exists(rsp) Then m_ResponseFile = rsp Else m_ResponseFile =
""
rsp = IO.Path.Combine(m_BasePath, Name) & ".rsp"
@@ -493,10 +497,20 @@
'Find the target of the test (exe, winexe, library, module)
m_Target = "exe" 'default target.
If m_RspFile <> "" Then
- m_Target = GetTarget(IO.File.ReadAllText(m_RspFile), m_Target)
+ contents = IO.File.ReadAllText(m_RspFile)
+ m_Target = GetTarget(contents, m_Target)
+ m_NoConfig = IsNoConfig(contents)
Else
- If m_DefaultRspFile <> "" Then m_Target =
GetTarget(IO.File.ReadAllText(m_DefaultRspFile), m_Target)
- If m_ResponseFile <> "" Then m_Target =
GetTarget(IO.File.ReadAllText(m_ResponseFile), m_Target)
+ If m_DefaultRspFile <> "" Then
+ contents = IO.File.ReadAllText(m_DefaultRspFile)
+ m_Target = GetTarget(contents, m_Target)
+ m_NoConfig = IsNoConfig(contents) OrElse m_NoConfig
+ End If
+ If m_ResponseFile <> "" Then
+ contents = IO.File.ReadAllText(m_ResponseFile)
+ m_Target = GetTarget(contents, m_Target)
+ m_NoConfig = IsNoConfig(contents) OrElse m_NoConfig
+ End If
End If
End Sub
@@ -792,6 +806,10 @@
m_OutputPath = IO.Path.Combine(m_BasePath, DefaultOutputPath)
End Sub
+ Private Function IsNoConfig(ByVal text As String) As Boolean
+ Return text.IndexOf("/noconfig", StringComparison.OrdinalIgnoreCase)
>= 0
+ End Function
+
Private Function GetTarget(ByVal text As String, ByVal DefaultTarget As
String) As String
If text.IndexOf("/target:exe", StringComparison.OrdinalIgnoreCase) >=
0 OrElse text.IndexOf("/t:exe", StringComparison.OrdinalIgnoreCase) >= 0 Then
Return "exe"
If text.IndexOf("/target:winexe", StringComparison.OrdinalIgnoreCase)
>= 0 OrElse text.IndexOf("/t:winexe", StringComparison.OrdinalIgnoreCase) >= 0
Then Return "exe"
Modified: trunk/vbnc/vbnc/source/Descriptors/TypeDescriptor.vb
===================================================================
--- trunk/vbnc/vbnc/source/Descriptors/TypeDescriptor.vb 2006-09-11
23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/source/Descriptors/TypeDescriptor.vb 2006-09-12
00:17:10 UTC (rev 65265)
@@ -833,6 +833,9 @@
If o Is Me Then
result = True
ElseIf TypeOf o Is TypeDescriptor Then
+ If o.IsByRef AndAlso Me.IsByRef Then Return
Me.GetElementType.Equals(o.GetElementType)
+ If o.IsArray AndAlso Me.IsArray Then Return
Me.GetElementType.Equals(o.GetElementType)
+
result = NameResolution.CompareName(oName, MeName)
#If DEBUG Then
If result Then
Modified: trunk/vbnc/vbnc/source/Emit/EmitStack.vb
===================================================================
--- trunk/vbnc/vbnc/source/Emit/EmitStack.vb 2006-09-11 23:05:38 UTC (rev
65264)
+++ trunk/vbnc/vbnc/source/Emit/EmitStack.vb 2006-09-12 00:17:10 UTC (rev
65265)
@@ -19,7 +19,7 @@
#If DEBUG Then
-#Const DEBUGSTACKTYPES = 1
+#Const DEBUGSTACKTYPES = 0
#Const LOGDEBUGSTACKTYPES = 0
#End If
@@ -80,6 +80,12 @@
End Function
Shadows Function Pop(ByVal Type As Type) As Type
+ Dim logStack As Boolean = False
+
+#If LOGDEBUGSTACKTYPES Then
+ logStack = True
+#End If
+
#If DEBUGSTACKTYPES Then
If Count = 0 Then
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
String.Format("Trying to pop type '{0}' off the stack, but stack is empty.",
Type.ToString))
@@ -101,12 +107,16 @@
End If
End If
End If
-#If LOGDEBUGSTACKTYPES Then
- Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
String.Format("Popped stack type ({1} left on the stack): {0,-30} Stack now:
{2}", tmp.ToString, Count.ToString, StackState))
-#End If
+ If logStack Then
+ Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
String.Format("Popped stack type ({1} left on the stack): {0,-30} Stack now:
{2}", tmp.ToString, Count.ToString, StackState))
+ End If
Return tmp
#Else
- Return MyBase.Pop()
+ If Count > 0 Then
+ Return MyBase.Pop()
+ Else
+ Return Nothing
+ End If
#End If
End Function
Modified: trunk/vbnc/vbnc/source/Expressions/Conversions/DirectCastExpression.vb
===================================================================
--- trunk/vbnc/vbnc/source/Expressions/Conversions/DirectCastExpression.vb
2006-09-11 23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/source/Expressions/Conversions/DirectCastExpression.vb
2006-09-12 00:17:10 UTC (rev 65265)
@@ -30,23 +30,27 @@
Protected Overrides Function GenerateCodeInternal(ByVal Info As EmitInfo)
As Boolean
Dim result As Boolean = True
- If Expression.ExpressionType.IsValueType Then
- If Helper.CompareType(ExpressionType, Expression.ExpressionType)
Then
+ If ExpressionType.IsGenericParameter Then
+ result = Expression.GenerateCode(Info.Clone(True, False,
Expression.ExpressionType)) AndAlso result
+ Emitter.EmitUnbox_Any(Info, ExpressionType)
+ Else
+ If Expression.ExpressionType.IsValueType Then
+ If Helper.CompareType(ExpressionType,
Expression.ExpressionType) Then
+ result = Expression.GenerateCode(Info.Clone(True, False,
Expression.ExpressionType)) AndAlso result
+ Else
+ Helper.NotImplemented()
+ End If
+ ElseIf ExpressionType.IsGenericParameter = False AndAlso
Expression.ExpressionType.IsClass AndAlso ExpressionType.IsValueType Then
result = Expression.GenerateCode(Info.Clone(True, False,
Expression.ExpressionType)) AndAlso result
+ Emitter.EmitUnbox(Info, ExpressionType)
+ Emitter.EmitLoadObject(Info, ExpressionType)
Else
- Helper.NotImplemented()
+ result = Expression.GenerateCode(Info.Clone(True, False,
Expression.ExpressionType)) AndAlso result
+ If Helper.CompareType(Expression.ExpressionType,
ExpressionType) = False Then
+ Emitter.EmitCastClass(Info, Expression.ExpressionType,
ExpressionType)
+ End If
End If
- ElseIf ExpressionType.IsGenericParameter = False AndAlso
Expression.ExpressionType.IsClass AndAlso ExpressionType.IsValueType Then
- result = Expression.GenerateCode(Info.Clone(True, False,
Expression.ExpressionType)) AndAlso result
- Emitter.EmitUnbox(Info, ExpressionType)
- Emitter.EmitLoadObject(Info, ExpressionType)
- Else
- result = Expression.GenerateCode(Info.Clone(True, False,
Expression.ExpressionType)) AndAlso result
- If Helper.CompareType(Expression.ExpressionType, ExpressionType) =
False Then
- Emitter.EmitCastClass(Info, Expression.ExpressionType,
ExpressionType)
- End If
End If
-
Return result
End Function
Modified: trunk/vbnc/vbnc/source/Expressions/InvocationOrIndexExpression.vb
===================================================================
--- trunk/vbnc/vbnc/source/Expressions/InvocationOrIndexExpression.vb
2006-09-11 23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/source/Expressions/InvocationOrIndexExpression.vb
2006-09-12 00:17:10 UTC (rev 65265)
@@ -48,6 +48,13 @@
Private m_ConstantValue As Object
Private m_ExpressionType As Type
+ ' AscW is replaced with the first parameter casted to Integer when:
+ ' /novbruntimeref is used
+ ' the called AscW is declared in the code being compiled
+ ' the called AscW is Shared or is declared in a Module
+ ' the first argument of the the called AscW is a ByVal Char
+ Private m_AscWExpression As Expression
+
''' <summary>
''' If this method is not nothing then the arguments are emitted and then
the method is called.
''' </summary>
@@ -67,6 +74,14 @@
Public Overrides ReadOnly Property IsConstant() As Boolean
Get
If m_ConstantValue IsNot Nothing Then Return True
+ If m_AscWExpression IsNot Nothing Then
+ If m_AscWExpression.IsConstant Then
+ m_ConstantValue =
Microsoft.VisualBasic.AscW(CChar(m_AscWExpression.ConstantValue))
+ Return True
+ Else
+ Return False
+ End If
+ End If
If m_ArgumentList.Count <> 1 Then Return False
If m_Expression.Classification.IsMethodGroupClassification Then
Dim param As Object
@@ -111,6 +126,12 @@
Protected Overrides Function GenerateCodeInternal(ByVal Info As EmitInfo)
As Boolean
Dim result As Boolean = True
+ If m_AscWExpression IsNot Nothing Then
+ result = m_AscWExpression.GenerateCode(Info.Clone(True, False,
TypeCache.Char)) AndAlso result
+ Info.Stack.SwitchHead(TypeCache.Char, TypeCache.Integer)
+ Return result
+ End If
+
If m_InvocationMethod IsNot Nothing Then
result = Helper.EmitArgumentsAndCallOrCallVirt(Info, m_Expression,
m_ArgumentList, m_InvocationMethod) AndAlso result
Return True
@@ -410,10 +431,24 @@
End If
If mgc.ResolvedMethodInfo IsNot Nothing Then
- If mgc.ResolvedMethodInfo.ReturnType Is Nothing Then
+ Dim methodInfo As MethodInfo = mgc.ResolvedMethodInfo
+
+ If Compiler.CommandLine.NoVBRuntimeRef AndAlso
Compiler.Assembly.IsDefinedHere(methodInfo.DeclaringType) AndAlso
methodInfo.IsStatic AndAlso Helper.CompareNameOrdinal(methodInfo.Name, "AscW")
Then
+ Dim methodParameters() As ParameterInfo =
Helper.GetParameters(Compiler, methodInfo)
+
+ If methodParameters.Length <> 0 AndAlso
Helper.CompareType(methodParameters(0).ParameterType, TypeCache.Char) Then
+ m_AscWExpression = ArgumentList(0).Expression
+ If m_AscWExpression.IsConstant Then m_ConstantValue =
Microsoft.VisualBasic.AscW(CChar(m_AscWExpression.ConstantValue))
+ Classification = New ValueClassification(Me,
TypeCache.Integer)
+ m_ExpressionType = TypeCache.Integer
+ Return result
+ End If
+ End If
+
+ If methodInfo.ReturnType Is Nothing Then
Classification = New VoidClassification(Me)
Else
- Classification = New ValueClassification(Me,
mgc.ResolvedMethodInfo.ReturnType)
+ Classification = New ValueClassification(Me,
methodInfo.ReturnType)
End If
ElseIf mgc.ResolvedConstructor IsNot Nothing Then
Classification = New VoidClassification(Me)
Modified: trunk/vbnc/vbnc/source/Expressions/SimpleNameExpression.vb
===================================================================
--- trunk/vbnc/vbnc/source/Expressions/SimpleNameExpression.vb 2006-09-11
23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/source/Expressions/SimpleNameExpression.vb 2006-09-12
00:17:10 UTC (rev 65265)
@@ -779,11 +779,14 @@
Dim modules As TypeList = imps.GetModules(Me)
Dim found As Generic.List(Of MemberInfo)
found = Helper.GetMembersOfTypes(modules, Name)
- If found.Count = 1 Then
+ If found.Count >= 1 Then
If Helper.IsMethodDeclaration(found(0)) Then
Classification = New MethodGroupClassification(Me, Nothing,
Nothing, found)
Return True
End If
+ If found.Count > 1 Then
+ helper.adderror()
+ End If
If Helper.IsTypeDeclaration(found(0)) Then
Classification = New TypeClassification(Me, found(0))
Return True
@@ -798,8 +801,6 @@
End If
Helper.NotImplemented()
Return True
- ElseIf found.Count > 1 Then
- Helper.AddError()
End If
Return False
Modified: trunk/vbnc/vbnc/source/General/AssemblyInfo.vb
===================================================================
--- trunk/vbnc/vbnc/source/General/AssemblyInfo.vb 2006-09-11 23:05:38 UTC
(rev 65264)
+++ trunk/vbnc/vbnc/source/General/AssemblyInfo.vb 2006-09-12 00:17:10 UTC
(rev 65265)
@@ -49,5 +49,5 @@
' 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.4706")>
+<Assembly: AssemblyVersion("0.0.0.4732")>
Modified: trunk/vbnc/vbnc/source/General/Compiler.vb
===================================================================
--- trunk/vbnc/vbnc/source/General/Compiler.vb 2006-09-11 23:05:38 UTC (rev
65264)
+++ trunk/vbnc/vbnc/source/General/Compiler.vb 2006-09-12 00:17:10 UTC (rev
65265)
@@ -17,6 +17,10 @@
' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
'
+#If DEBUG Then
+#Const EXTENDEDDEBUG = 0
+#End If
+
''' <summary>
''' The compiler
''' </summary>
@@ -213,6 +217,7 @@
Private Function CreateTestOutputFilename(ByVal Filename As String, ByVal
TestType As String) As String
Dim dir As String
dir = IO.Path.GetDirectoryName(Filename)
+ If dir = "" Then dir = Environment.CurrentDirectory
'dir = IO.Path.Combine(IO.Path.GetDirectoryName(Filename), "test
output")
If IO.Directory.Exists(dir) = False Then
IO.Directory.CreateDirectory(dir)
@@ -291,6 +296,7 @@
Else
m_OutFilename = CommandLine.Out
End If
+ m_OutFilename = IO.Path.GetFullPath(m_OutFilename)
Return True
End Function
@@ -362,7 +368,7 @@
Private Function Compile_Resolve() As Boolean
Dim result As Boolean = True
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Report.WriteLine(vbnc.Report.ReportLevels.Debug, "Starting Resolve")
#End If
result = CommandLine.Imports.ResolveCode(ResolveInfo.Default) AndAlso
result
Modified: trunk/vbnc/vbnc/source/General/Helper.vb
===================================================================
--- trunk/vbnc/vbnc/source/General/Helper.vb 2006-09-11 23:05:38 UTC (rev
65264)
+++ trunk/vbnc/vbnc/source/General/Helper.vb 2006-09-12 00:17:10 UTC (rev
65265)
@@ -887,7 +887,7 @@
result = ArrayVariable.GenerateCode(Info.Clone(True, False,
ArrayType)) AndAlso result
If isArraySetValue Then
- result = newValue.GenerateCode(Info.Clone(ElementType)) AndAlso
result
+ result = newValue.GenerateCode(Info.Clone(True, False,
ElementType)) AndAlso result
If ElementType.IsValueType Then
Emitter.EmitBox(Info)
End If
Modified: trunk/vbnc/vbnc/source/General/Scanner.vb
===================================================================
--- trunk/vbnc/vbnc/source/General/Scanner.vb 2006-09-11 23:05:38 UTC (rev
65264)
+++ trunk/vbnc/vbnc/source/General/Scanner.vb 2006-09-12 00:17:10 UTC (rev
65265)
@@ -19,7 +19,8 @@
#Const SUPPORT_CSTYLE_COMMENTS = 1
#If DEBUG Then
-#Const DOEOFCHECK = 1
+#Const DOEOFCHECK = 0
+#Const EXTENDEDDEBUG = 0
#End If
#Const EXTENDED = False
@@ -680,7 +681,7 @@
#End If
Case IntegerBase.Hex
Try
- Console.WriteLine("Hex: " & strResult)
+ 'Console.WriteLine("Hex: " & strResult)
IntegerValue = Helper.HexToInt(strResult)
Catch ex As Exception
Compiler.Report.ShowMessage(Messages.VBNC90006,
Me.GetCurrentLocation, "hexadecimal")
@@ -1186,7 +1187,7 @@
'The entry point:
Sub ScanFile(ByVal File As CodeFile, ByVal Tokens As Tokens)
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim t As Double = Microsoft.VisualBasic.Timer()
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug, "Scanning
file " & File.FileName & " ")
#End If
Modified: trunk/vbnc/vbnc/source/General/TypeManager.vb
===================================================================
--- trunk/vbnc/vbnc/source/General/TypeManager.vb 2006-09-11 23:05:38 UTC
(rev 65264)
+++ trunk/vbnc/vbnc/source/General/TypeManager.vb 2006-09-12 00:17:10 UTC
(rev 65265)
@@ -17,6 +17,10 @@
' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
'
+#If DEBUG Then
+#Const EXTENDEDDEBUG = 0
+#End If
+
''' <summary>
''' A helper class containing all information about the referenced assemblies,
''' loaded types, etc.
@@ -192,7 +196,7 @@
result = LoadReferencedAssemblies() AndAlso result
result = LoadReferencedTypes() AndAlso result
LoadCompiledTypes()
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Compiler.Report.WriteLine(String.Format("{0} assemblies were loaded.",
Assemblies.Count.ToString))
If Compiler.CommandLine.Verbose Then
For i As Integer = 0 To Assemblies.Count - 1
Modified: trunk/vbnc/vbnc/source/Members/MemberImplementsClause.vb
===================================================================
--- trunk/vbnc/vbnc/source/Members/MemberImplementsClause.vb 2006-09-11
23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/source/Members/MemberImplementsClause.vb 2006-09-12
00:17:10 UTC (rev 65265)
@@ -17,6 +17,10 @@
' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
'
+#If DEBUG Then
+#Const EXTENDEDDEBUG = 0
+#End If
+
''' <summary>
''' ImplementsClause ::= "Implements" ImplementsList
''' </summary>
@@ -65,7 +69,9 @@
Helper.Assert(methodI IsNot Nothing)
Builder.DefineMethodOverride(Method, methodI)
+#If EXTENDEDDEBUG Then
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug, "Defined
method override '" & Builder.FullName & ":" & Method.Name & "' overrides or
implements '" & methodI.DeclaringType.FullName & ":" & methodI.Name & "'")
+#End If
Next
Return result
End Function
Modified: trunk/vbnc/vbnc/source/Members/Parameter.vb
===================================================================
--- trunk/vbnc/vbnc/source/Members/Parameter.vb 2006-09-11 23:05:38 UTC (rev
65264)
+++ trunk/vbnc/vbnc/source/Members/Parameter.vb 2006-09-12 00:17:10 UTC (rev
65265)
@@ -168,7 +168,7 @@
Overloads Function Define(ByVal Builder As MethodBuilder) As Boolean
m_ParameterBuilder = Builder.DefineParameter(Position,
m_ParameterAttributes, Name)
If m_ParameterBuilder.IsOptional Then
- If Me.ParameterType.IsByRef AndAlso m_ConstantValue IsNot Nothing
Then
+ If Helper.IsOnMS AndAlso ((Me.ParameterType.IsByRef AndAlso
m_ConstantValue IsNot Nothing) OrElse (m_ParameterType.Equals(TypeCache.Object)
AndAlso m_ConstantValue IsNot Nothing AndAlso
m_ConstantValue.GetType.Equals(TypeCache.Object) = False)) Then
'HACK (a really big one...)
'The reflection.Emit is not able to set a constant value when
the
'parameter type is a byref type. Do all this to bypass all
checks.
@@ -185,6 +185,7 @@
mthd.Invoke(Nothing, New Object() {m, tk, v})
'END HACK
Else
+ 'Helper.Assert(m_ConstantValue Is Nothing OrElse
(Type.GetTypeCode(m_ConstantValue.GetType) = Type.GetTypeCode(m_ParameterType))
OrElse m_ParameterType.IsEnum)
m_ParameterBuilder.SetConstant(m_ConstantValue)
End If
End If
Modified: trunk/vbnc/vbnc/source/Parser/Parser.vb
===================================================================
--- trunk/vbnc/vbnc/source/Parser/Parser.vb 2006-09-11 23:05:38 UTC (rev
65264)
+++ trunk/vbnc/vbnc/source/Parser/Parser.vb 2006-09-12 00:17:10 UTC (rev
65265)
@@ -17,6 +17,10 @@
' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
'
+#If DEBUG Then
+#Const EXTENDEDDEBUG = 0
+#End If
+
Partial Public Class Parser
Private tm As tm
Private m_Compiler As Compiler
@@ -384,7 +388,7 @@
Dim AssemblyTypes As New MemberDeclarations(result)
Do Until tm.CurrentToken.IsEndOfCode
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iFileCount, iTotalFiles As Integer
iFileCount += 1
iTotalFiles = Me.Compiler.CommandLine.Files.Count
Modified: trunk/vbnc/vbnc/source/TypeDeclarations/AssemblyDeclaration.vb
===================================================================
--- trunk/vbnc/vbnc/source/TypeDeclarations/AssemblyDeclaration.vb
2006-09-11 23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/source/TypeDeclarations/AssemblyDeclaration.vb
2006-09-12 00:17:10 UTC (rev 65265)
@@ -17,6 +17,9 @@
' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
'
#Const DEBUGRESOLVE = True
+#If DEBUG Then
+#Const EXTENDEDDEBUG = 0
+#End If
Imports System.Reflection.Emit
@@ -177,7 +180,7 @@
Dim result As Boolean = True
For Each type As TypeDeclaration In m_TypeDeclarations
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Try
@@ -207,7 +210,7 @@
Dim result As Boolean = True
For Each type As TypeDeclaration In m_TypeDeclarations
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
"ResolveType " & type.FullName & " (" & iCount & " of " &
m_TypeDeclarations.Length & " types)")
@@ -234,7 +237,7 @@
Dim result As Boolean = True
For Each Type As TypeDeclaration In Me.Types
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
"CreateImplicitTypes " & Type.FullName & " (" & iCount & " of " &
m_TypeDeclarations.Length & " types)")
@@ -266,7 +269,7 @@
Dim result As Boolean = True
For Each type As TypeDeclaration In m_TypeDeclarations
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
"ResolveTypeReferences " & type.FullName & " (" & iCount & " of " &
m_TypeDeclarations.Length & " types)")
@@ -304,7 +307,7 @@
Dim result As Boolean = True
For Each Type As TypeDeclaration In Me.Types
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
"CreateImplicitMembers " & Type.FullName & " (" & iCount & " of " &
m_TypeDeclarations.Length & " types)")
@@ -336,7 +339,7 @@
Dim result As Boolean = True
For Each type As TypeDeclaration In m_TypeDeclarations
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
"ResolveMembers " & type.FullName & " (" & iCount & " of " &
m_TypeDeclarations.Length & " types)")
@@ -379,7 +382,7 @@
Dim result As Boolean = True
For Each type As TypeDeclaration In m_TypeDeclarations
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
"DefineTypes " & type.FullName & " (" & iCount & " of " &
m_TypeDeclarations.Length & " types)")
@@ -402,7 +405,7 @@
Dim result As Boolean = True
For Each type As TypeDeclaration In m_TypeDeclarations
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
"DefineTypeHierarchy " & type.FullName & " (" & iCount & " of " &
m_TypeDeclarations.Length & " types)")
@@ -417,7 +420,7 @@
Dim result As Boolean = True
For Each type As TypeDeclaration In m_TypeDeclarations
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug,
"DefineTypeParameters " & type.FullName & " (" & iCount & " of " &
m_TypeDeclarations.Length & " types)")
@@ -437,7 +440,7 @@
Dim result As Boolean = True
For Each type As TypeDeclaration In m_TypeDeclarations
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Try
@@ -481,7 +484,7 @@
result = EmitAttributes() AndAlso result
For Each type As TypeDeclaration In m_TypeDeclarations
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Try
@@ -554,7 +557,7 @@
Dim tps As New Generic.List(Of TypeDeclaration)
For Each type As TypeDeclaration In m_TypeDeclarations
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Dim iCount As Integer
iCount += 1
Try
@@ -569,7 +572,7 @@
End Try
#End If
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
Try
result = CreateType(type) AndAlso result
Catch ex As Exception
@@ -587,11 +590,11 @@
tps.Add(type)
End Try
#Else
- result = CreateType(type) AndAlso result
+ result = CreateType(type) AndAlso result
#End If
Next
-#If DEBUG Then
+#If EXTENDEDDEBUG Then
If exs.Count > 0 Then
Dim msg As String = ""
Modified: trunk/vbnc/vbnc/source/TypeDeclarations/ModuleDeclaration.vb
===================================================================
--- trunk/vbnc/vbnc/source/TypeDeclarations/ModuleDeclaration.vb
2006-09-11 23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/source/TypeDeclarations/ModuleDeclaration.vb
2006-09-12 00:17:10 UTC (rev 65265)
@@ -40,6 +40,8 @@
MyBase.CustomAttributes.Add(New Attribute(Me,
TypeCache.StandardModuleAttribute))
result = MyBase.ResolveType AndAlso result
+ Me.FindDefaultConstructors()
+
Return result
End Function
@@ -67,7 +69,7 @@
Private Function CreateImplicitMembers() As Boolean Implements
IHasImplicitMembers.CreateImplicitMembers
Dim result As Boolean = True
- If DefaultSharedConstructor Is Nothing AndAlso
Me.HasSharedConstantFields Then
+ If DefaultSharedConstructor Is Nothing AndAlso
(Me.HasSharedConstantFields OrElse Me.HasSharedFieldsWithInitializers) Then
DefaultSharedConstructor = New ConstructorDeclaration(Me)
DefaultSharedConstructor.Init(Nothing, New
Modifiers(DefaultSharedConstructor, KS.Shared), New
SubSignature(DefaultSharedConstructor,
ConstructorDeclaration.SharedConstructorName, New
ParameterList(DefaultSharedConstructor)), New
CodeBlock(DefaultSharedConstructor))
result = DefaultSharedConstructor.ResolveTypeReferences AndAlso
result
Modified: trunk/vbnc/vbnc/source/TypeDeclarations/TypeDeclaration.vb
===================================================================
--- trunk/vbnc/vbnc/source/TypeDeclarations/TypeDeclaration.vb 2006-09-11
23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/source/TypeDeclarations/TypeDeclaration.vb 2006-09-12
00:17:10 UTC (rev 65265)
@@ -16,7 +16,9 @@
' License along with this library; if not, write to the Free Software
' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
'
-
+#If DEBUG Then
+#Const EXTENDEDDEBUG = 0
+#End If
''' <summary>
''' TypeDeclaration Hierarchy:
'''
@@ -437,7 +439,9 @@
End If
'HACK!!!
+#If EXTENDEDDEBUG Then
Report.WriteLine(vbnc.Report.ReportLevels.Debug, "Creating: " &
Me.FullName)
+#End If
If m_TypeBuilder IsNot Nothing Then
m_FinalType = m_TypeBuilder.CreateType()
ElseIf m_EnumBuilder IsNot Nothing Then
@@ -445,8 +449,9 @@
Else
Throw New InternalException(Me)
End If
+#If EXTENDEDDEBUG Then
Report.WriteLine(vbnc.Report.ReportLevels.Debug, "Created: " &
Me.FullName)
-
+#End If
Return True
End Function
Modified: trunk/vbnc/vbnc/source/Types/TypeNameResolutionInfo.vb
===================================================================
--- trunk/vbnc/vbnc/source/Types/TypeNameResolutionInfo.vb 2006-09-11
23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/source/Types/TypeNameResolutionInfo.vb 2006-09-12
00:17:10 UTC (rev 65265)
@@ -589,10 +589,14 @@
Dim current As BaseObject = FromWhere
Do
If CheckNamespace(R,
FromWhere.Compiler.TypeManager.GetTypesByNamespace(ns), TypeArgumentCount) Then
Return True
- If Helper.NameCompare(ns.ToString(), R) OrElse
ns.ToString().EndsWith("." & R, NameResolution.StringComparison) Then
+ If Helper.NameCompare(ns, R) OrElse ns.EndsWith("." & R,
NameResolution.StringComparison) Then
m_FoundObjects.Add(FromWhere.Compiler.TypeManager.Namespaces(ns))
Return True
End If
+ If ns <> "" AndAlso TypeArgumentCount = 0 AndAlso
FromWhere.Compiler.TypeManager.Namespaces.ContainsKey(ns & "." & R) Then
+
m_FoundObjects.Add(FromWhere.Compiler.TypeManager.Namespaces(ns & "." & R))
+ Return True
+ End If
ns = vbnc.Helper.GetNamespaceParent(ns)
Loop Until ns Is Nothing
Added: trunk/vbnc/vbnc/tests/CompileTime/DirectCast1.vb
===================================================================
--- trunk/vbnc/vbnc/tests/CompileTime/DirectCast1.vb 2006-09-11 23:05:38 UTC
(rev 65264)
+++ trunk/vbnc/vbnc/tests/CompileTime/DirectCast1.vb 2006-09-12 00:17:10 UTC
(rev 65265)
@@ -0,0 +1,5 @@
+Class DirectCast1
+ Public Shared Function ToGenericParameter(Of T)(ByVal Value As Object) As T
+ Return DirectCast(Value, T)
+ End Function
+End Class
Deleted: trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.response
===================================================================
--- trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.response 2006-09-11
23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.response 2006-09-12
00:17:10 UTC (rev 65265)
@@ -1 +0,0 @@
-/novbruntimeref
\ No newline at end of file
Added: trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.rsp
===================================================================
--- trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.rsp 2006-09-11
23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.rsp 2006-09-12
00:17:10 UTC (rev 65265)
@@ -0,0 +1,6 @@
+/target:library
+/novbruntimeref
+/verbose
+/noconfig
+/nostdlib
+NoVBRuntimeRef1.vb
\ No newline at end of file
Modified: trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.vb
===================================================================
--- trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.vb 2006-09-11
23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/tests/CompileTime/NoVBRuntimeRef1.vb 2006-09-12
00:17:10 UTC (rev 65265)
@@ -1,27 +1,42 @@
Option Strict On
-Public Class novbruntimeref
- Public Shared Function AscW(ByVal x As Char, ByVal y as String) As
Integer
+Namespace NoVBRuntimeRef1
+ Public Class novbruntimeref
+ Public Const x As Integer = AscW("x"c, "x")
+
+ Public Shared Function AscW(ByVal x As Char, ByVal y As String) As
Integer
Return AscW(x, "x"c)
End Function
+ Public Shared Function AscW(Optional ByVal x As Char = "x"c) As Integer
+ Return AscW()
+ End Function
+
Public Shared Function Asc1(ByVal x As Char) As Integer
Return AscW(x, x)
End Function
-End Class
-Class novbruntimeref1
- Public Shared Function Ascw(ByVal x As Char, ByVal y as Char) As
Integer
+ Public Shared Function Asc2(ByVal x As Char) As Integer
+ Return AscW("x"c, x)
+ End Function
+ End Class
+
+ Class novbruntimeref1
+ Public Shared Function Ascw(ByVal x As Char, ByVal y As Char) As
Integer
Return Ascw(x, y)
End Function
+ Public Shared Sub Ascw(ByVal x As Char)
+ End Sub
+
Public Shared Function Asc1(ByVal x As Char) As Integer
- Return Ascw(x, x)
+ Return Ascw(x)
End Function
-End Class
+ End Class
-Class novbruntimeref2
+ Class novbruntimeref2
Public Shared Function Asc1(ByVal x As Char) As Integer
Return novbruntimeref.AscW(x, x)
End Function
-End Class
+ End Class
+End Namespace
Added: trunk/vbnc/vbnc/tests/CompileTime2/ConstructorInitialization6.vb
===================================================================
--- trunk/vbnc/vbnc/tests/CompileTime2/ConstructorInitialization6.vb
2006-09-11 23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/tests/CompileTime2/ConstructorInitialization6.vb
2006-09-12 00:17:10 UTC (rev 65265)
@@ -0,0 +1,12 @@
+Imports System
+Imports System.Collections
+Imports System.Reflection
+
+Namespace ConstructorInitialization6
+ Module Test
+ Public Value As Integer = 2
+ Function Main() As Integer
+ Return Value - 2
+ End Function
+ End Module
+End Namespace
\ No newline at end of file
Added: trunk/vbnc/vbnc/tests/CompileTime2/ConstructorInitialization7.vb
===================================================================
--- trunk/vbnc/vbnc/tests/CompileTime2/ConstructorInitialization7.vb
2006-09-11 23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/tests/CompileTime2/ConstructorInitialization7.vb
2006-09-12 00:17:10 UTC (rev 65265)
@@ -0,0 +1,18 @@
+Imports System
+Imports System.Collections
+Imports System.Reflection
+
+Namespace ConstructorInitialization7
+ Module Test
+ Public Value1 As Integer = 2
+ Public Value2 As Integer
+
+ Sub New()
+ Value2 = 3
+ End Sub
+
+ Function Main() As Integer
+ Return Value1 - Value2 + 1
+ End Function
+ End Module
+End Namespace
\ No newline at end of file
Added: trunk/vbnc/vbnc/tests/CompileTime2/FirstLinuxProgram.vb
===================================================================
--- trunk/vbnc/vbnc/tests/CompileTime2/FirstLinuxProgram.vb 2006-09-11
23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/tests/CompileTime2/FirstLinuxProgram.vb 2006-09-12
00:17:10 UTC (rev 65265)
@@ -0,0 +1,6 @@
+public class compiler
+shared function Main as integer
+Console.WriteLine ("Dingus")
+return 0
+End function
+end class
\ No newline at end of file
Added: trunk/vbnc/vbnc/tests/FailsIncorrectly/NoOutDir1.rsp
===================================================================
--- trunk/vbnc/vbnc/tests/FailsIncorrectly/NoOutDir1.rsp 2006-09-11
23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/tests/FailsIncorrectly/NoOutDir1.rsp 2006-09-12
00:17:10 UTC (rev 65265)
@@ -0,0 +1,2 @@
+/out:test.exe
+NoOutDir1.vb
\ No newline at end of file
Added: trunk/vbnc/vbnc/tests/FailsIncorrectly/NoOutDir1.vb
===================================================================
--- trunk/vbnc/vbnc/tests/FailsIncorrectly/NoOutDir1.vb 2006-09-11 23:05:38 UTC
(rev 65264)
+++ trunk/vbnc/vbnc/tests/FailsIncorrectly/NoOutDir1.vb 2006-09-12 00:17:10 UTC
(rev 65265)
@@ -0,0 +1,5 @@
+Class NoOutDir1
+ Shared Function Main() As Integer
+ Return 0
+ End Function
+End Class
Added: trunk/vbnc/vbnc/tests/FailsIncorrectly/readme.txt
===================================================================
--- trunk/vbnc/vbnc/tests/FailsIncorrectly/readme.txt 2006-09-11 23:05:38 UTC
(rev 65264)
+++ trunk/vbnc/vbnc/tests/FailsIncorrectly/readme.txt 2006-09-12 00:17:10 UTC
(rev 65265)
@@ -0,0 +1 @@
+These tests fail rt execution, but they are correct anyway.
\ No newline at end of file
Modified: trunk/vbnc/vbnc/tests/VBRunTime/Microsoft.VisualBasic.files.rsp
===================================================================
--- trunk/vbnc/vbnc/tests/VBRunTime/Microsoft.VisualBasic.files.rsp
2006-09-11 23:05:38 UTC (rev 65264)
+++ trunk/vbnc/vbnc/tests/VBRunTime/Microsoft.VisualBasic.files.rsp
2006-09-12 00:17:10 UTC (rev 65265)
@@ -77,8 +77,5 @@
..\..\..\..\vbruntime\Microsoft.VisualBasic\Microsoft.VisualBasic.ApplicationServices\User.vb
..\..\..\..\vbruntime\Microsoft.VisualBasic\Microsoft.VisualBasic.ApplicationServices\WindowsFormsApplicationBase.vb
..\..\..\..\vbruntime\Microsoft.VisualBasic\Microsoft.VisualBasic.Devices\Computer.vb
-"..\..\..\..\vbruntime\Microsoft.VisualBasic\My
Project\Application.Designer.vb"
-"..\..\..\..\vbruntime\Microsoft.VisualBasic\My Project\Resources.Designer.vb"
-"..\..\..\..\vbruntime\Microsoft.VisualBasic\My Project\Settings.Designer.vb"
"/res:..\..\..\..\vbruntime\Microsoft.VisualBasic\strings.resources"
"/keyfile:..\..\..\..\vbruntime\Microsoft.VisualBasic\msfinal.pub"
\ No newline at end of file
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches