Author: rolf
Date: 2006-09-12 04:58:19 -0400 (Tue, 12 Sep 2006)
New Revision: 65277
Modified:
trunk/vbnc/vbnc/source/Expressions/InvocationOrIndexExpression.vb
Log:
Removed duplicate code.
Modified: trunk/vbnc/vbnc/source/Expressions/InvocationOrIndexExpression.vb
===================================================================
--- trunk/vbnc/vbnc/source/Expressions/InvocationOrIndexExpression.vb
2006-09-12 08:56:26 UTC (rev 65276)
+++ trunk/vbnc/vbnc/source/Expressions/InvocationOrIndexExpression.vb
2006-09-12 08:58:19 UTC (rev 65277)
@@ -50,7 +50,7 @@
' 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 declared in the module 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
@@ -129,6 +129,7 @@
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
@@ -433,14 +434,14 @@
If mgc.ResolvedMethodInfo IsNot 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
+ If Compiler.CommandLine.NoVBRuntimeRef AndAlso
methodInfo.DeclaringType.Module Is Compiler.ModuleBuilder 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
+ Classification = New ValueClassification(Me,
m_ExpressionType)
+
Return result
End If
End If
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches