Author: rolf
Date: 2007-03-16 19:02:24 -0500 (Fri, 16 Mar 2007)
New Revision: 74504
Modified:
trunk/mono-basic/vbnc/vbnc/source/ChangeLog
trunk/mono-basic/vbnc/vbnc/source/Code/CodeBlock.vb
trunk/mono-basic/vbnc/vbnc/source/Descriptors/ParameterDescriptor.vb
trunk/mono-basic/vbnc/vbnc/source/General/AssemblyInfo.vb
trunk/mono-basic/vbnc/vbnc/source/General/CommandLine.vb
trunk/mono-basic/vbnc/vbnc/source/General/Compiler.vb
trunk/mono-basic/vbnc/vbnc/source/Members/Attribute.vb
trunk/mono-basic/vbnc/vbnc/source/Members/MethodDeclaration.vb
trunk/mono-basic/vbnc/vbnc/source/Members/Parameter.vb
trunk/mono-basic/vbnc/vbnc/source/TypeDeclarations/TypeDeclaration.vb
trunk/mono-basic/vbnc/vbnc/source/vbnc.vbproj
Log:
* vbnc.vbproj: Update.
* Members/Attribute.vb: Implement emission of field and property values
for attributes.
* Members/Parameter.vb: Small refactoring (variable renamed), and call
GenerateCode on the attributes, if any.
* Members/MethodDeclaration.vb: Parameters has code that has to be
emitted (attributes), so call GenerateCode on the them.
* Descriptors/ParameterDescriptor.vb: Small refactoring (variable
renamed).
* Code/CodeBlock.vb: Remove unused code.
* General/Compiler.vb: Don't emit debug info if requested not to.
* General/CommandLine.vb: Remove m_bDebugOn and only use m_eDebugInfo.
Default debug is none (fixes #81054).
Modified: trunk/mono-basic/vbnc/vbnc/source/ChangeLog
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/ChangeLog 2007-03-16 21:59:53 UTC (rev
74503)
+++ trunk/mono-basic/vbnc/vbnc/source/ChangeLog 2007-03-17 00:02:24 UTC (rev
74504)
@@ -1,3 +1,19 @@
+2007-03-17 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+
+ * vbnc.vbproj: Update.
+ * Members/Attribute.vb: Implement emission of field and property values
+ for attributes.
+ * Members/Parameter.vb: Small refactoring (variable renamed), and call
+ GenerateCode on the attributes, if any.
+ * Members/MethodDeclaration.vb: Parameters has code that has to be
+ emitted (attributes), so call GenerateCode on the them.
+ * Descriptors/ParameterDescriptor.vb: Small refactoring (variable
+ renamed).
+ * Code/CodeBlock.vb: Remove unused code.
+ * General/Compiler.vb: Don't emit debug info if requested not to.
+ * General/CommandLine.vb: Remove m_bDebugOn and only use m_eDebugInfo.
+ Default debug is none (fixes #81054).
+
2007-03-15 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* Statements/CallStatement.vb: If a call statement's target is a method
group, resolve it like an invocation expression.
Modified: trunk/mono-basic/vbnc/vbnc/source/Code/CodeBlock.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/Code/CodeBlock.vb 2007-03-16 21:59:53 UTC
(rev 74503)
+++ trunk/mono-basic/vbnc/vbnc/source/Code/CodeBlock.vb 2007-03-17 00:02:24 UTC
(rev 74504)
@@ -412,15 +412,6 @@
End If
#End If
- Dim symbolMethodOpened As Boolean
- If False AndAlso Compiler.SymbolWriter IsNot Nothing Then
- If Me.HasLocation AndAlso Me.Location.File IsNot Nothing Then
- Dim newT As New
Diagnostics.SymbolStore.SymbolToken(Me.ObjectID)
- Compiler.SymbolWriter.OpenMethod(newT)
- symbolMethodOpened = True
- End If
- End If
-
result = GenerateCode(info) AndAlso result
If Me.HasUnstructuredExceptionHandling = False Then
@@ -440,10 +431,6 @@
Emitter.EmitRet(info)
End If
- If symbolMethodOpened Then
- Compiler.SymbolWriter.CloseMethod()
- End If
-
#If EXTENDEDDEBUG Then
Compiler.Report.WriteLine(vbnc.Report.ReportLevels.Debug, "Method " &
Method.FullName & " emitted (ID: " & Method.ObjectID.ToString & ")")
#End If
Modified: trunk/mono-basic/vbnc/vbnc/source/Descriptors/ParameterDescriptor.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/Descriptors/ParameterDescriptor.vb
2007-03-16 21:59:53 UTC (rev 74503)
+++ trunk/mono-basic/vbnc/vbnc/source/Descriptors/ParameterDescriptor.vb
2007-03-17 00:02:24 UTC (rev 74504)
@@ -186,8 +186,8 @@
Dim result As Boolean
If m_Parameter IsNot Nothing Then
- If m_Parameter.Attributes IsNot Nothing Then
- result = m_Parameter.Attributes.IsDefined(attributeType)
+ If m_Parameter.CustomAttributes IsNot Nothing Then
+ result = m_Parameter.CustomAttributes.IsDefined(attributeType)
End If
If result = False AndAlso inherit = True Then
Helper.NotImplemented()
Modified: trunk/mono-basic/vbnc/vbnc/source/General/AssemblyInfo.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/General/AssemblyInfo.vb 2007-03-16
21:59:53 UTC (rev 74503)
+++ trunk/mono-basic/vbnc/vbnc/source/General/AssemblyInfo.vb 2007-03-17
00:02:24 UTC (rev 74504)
@@ -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.4842")>
+<Assembly: AssemblyVersion("0.0.0.4855")>
Modified: trunk/mono-basic/vbnc/vbnc/source/General/CommandLine.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/General/CommandLine.vb 2007-03-16
21:59:53 UTC (rev 74503)
+++ trunk/mono-basic/vbnc/vbnc/source/General/CommandLine.vb 2007-03-17
00:02:24 UTC (rev 74504)
@@ -195,14 +195,11 @@
''' <summary>
''' /debug[+|-] Emit debugging information.
- ''' </summary>
- Private m_bDebugOn As Boolean
-
- ''' <summary>
'''/debug:full Emit full debugging information (default).
'''/debug:pdbonly Emit PDB file only.
+ ''' According to #81054 vbc doesn't emit debug info unless /debug is
specified.
''' </summary>
- Private m_eDebugInfo As DebugTypes = DebugTypes.Full
+ Private m_eDebugInfo As DebugTypes = DebugTypes.None
' - ERRORS AND WARNINGS -
@@ -450,15 +447,6 @@
End Property
''' <summary>
- ''' /debug[+|-] Emit debugging information.
- ''' </summary>
- ReadOnly Property DebugOn() As Boolean
- Get
- Return m_bDebugOn
- End Get
- End Property
-
- ''' <summary>
'''/debug:full Emit full debugging information (default).
'''/debug:pdbonly Emit PDB file only.
''' </summary>
@@ -926,9 +914,9 @@
Case "removeintchecks-"
m_bRemoveIntChecks = False
Case "debug+"
- m_bDebugOn = True
+ m_eDebugInfo = DebugTypes.Full
Case "debug-"
- m_bDebugOn = False
+ m_eDebugInfo = DebugTypes.None
Case "debug"
Select Case LCase(strValue)
Case "full"
@@ -936,8 +924,7 @@
Case "pdbonly"
m_eDebugInfo = DebugTypes.PDB
Case ""
- m_eDebugInfo = DebugTypes.None
- m_bDebugOn = True 'only /debug enables debugging
information
+ m_eDebugInfo = DebugTypes.Full
Case Else
'TODO: AddError 2014 (saved).
Compiler.Report.SaveMessage(Messages.VBNC2019,
strName, strValue)
Modified: trunk/mono-basic/vbnc/vbnc/source/General/Compiler.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/General/Compiler.vb 2007-03-16
21:59:53 UTC (rev 74503)
+++ trunk/mono-basic/vbnc/vbnc/source/General/Compiler.vb 2007-03-17
00:02:24 UTC (rev 74504)
@@ -107,6 +107,9 @@
Private m_ConditionalCompiler As ConditionalCompiler
Private m_TypeCache As TypeCache
+#If ENABLECECIL Then
+ Private m_CecilTypeCache As CecilTypeCache
+#End If
'Private SequenceCompleted(CompilerSequence.Finished) As Boolean
Private SequenceTime(CompilerSequence.End) As DateTime
@@ -122,6 +125,14 @@
End Get
End Property
+#If ENABLECECIL Then
+ ReadOnly Property CecilTypeCache() As CecilTypeCache
+ Get
+ Return m_CecilTypeCache
+ End Get
+ End Property
+#End If
+
ReadOnly Property TypeCache() As TypeCache
Get
Return m_TypeCache
@@ -318,10 +329,10 @@
assemblyName = Me.Assembly.GetName
AssemblyBuilder =
System.AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName,
System.Reflection.Emit.AssemblyBuilderAccess.Save,
IO.Path.GetDirectoryName(m_OutFilename))
- ModuleBuilder = AssemblyBuilder.DefineDynamicModule(assemblyName.Name,
IO.Path.GetFileName(m_OutFilename), True)
+ ModuleBuilder = AssemblyBuilder.DefineDynamicModule(assemblyName.Name,
IO.Path.GetFileName(m_OutFilename), m_CommandLine.DebugInfo <>
vbnc.CommandLine.DebugTypes.None)
If m_CommandLine.DebugInfo <> vbnc.CommandLine.DebugTypes.None Then
- m_SymbolWriter = ModuleBuilder.GetSymWriter()
+ m_SymbolWriter = ModuleBuilder.GetSymWriter
End If
Return Compiler.Report.Errors = 0
@@ -396,6 +407,9 @@
If CommandLine.NoVBRuntimeRef Then
m_TypeCache.Init_vbruntime(True)
+#If ENABLECECIL Then
+ m_CecilTypeCache.Init_vbruntime(True)
+#End If
End If
SequenceTime(CompilerSequence.Resolved) = DateTime.Now
@@ -493,6 +507,10 @@
'Load all the referenced assemblies and load all the types and
namespaces into the type manager
m_TypeCache = New TypeCache(Me)
+#If ENABLECECIL Then
+ m_CecilTypeCache = New CecilTypeCache(Me)
+#End If
+
result = m_TypeManager.LoadReferenced AndAlso result
m_NameResolver = New NameResolution(Me) 'Must be created after
referenced assemblies have been loaded
m_TypeResolver = New TypeResolution(Me)
Modified: trunk/mono-basic/vbnc/vbnc/source/Members/Attribute.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/Members/Attribute.vb 2007-03-16
21:59:53 UTC (rev 74503)
+++ trunk/mono-basic/vbnc/vbnc/source/Members/Attribute.vb 2007-03-17
00:02:24 UTC (rev 74504)
@@ -34,10 +34,10 @@
Private m_ResolvedTypeConstructor As ConstructorInfo
Private m_Arguments As Object()
- Private m_Fields() As FieldInfo
- Private m_FieldValues() As Object
- Private m_Properties() As PropertyInfo
- Private m_PropertyValues() As Object
+ Private m_Fields As Generic.List(Of FieldInfo)
+ Private m_FieldValues As Generic.List(Of Object)
+ Private m_Properties As Generic.List(Of PropertyInfo)
+ Private m_PropertyValues As Generic.List(Of Object)
Private m_Instance As System.Attribute
@@ -172,8 +172,42 @@
End If
If m_AttributeArguments.VariablePropertyInitializerList IsNot
Nothing Then
+ Dim cache As MemberCache
+
+ cache = Info.Compiler.TypeManager.GetCache(m_ResolvedType)
+
For Each item As VariablePropertyInitializer In
m_AttributeArguments.VariablePropertyInitializerList
- Helper.NotImplementedYet("Resolution of attribute named
arguments")
+ Dim name As String
+ Dim member As MemberInfo
+ Dim members As Generic.List(Of MemberInfo)
+
+ name = item.IdentifierOrKeyword.Identifier
+ members = cache.LookupMembersFlattened(name)
+ If members.Count <> 1 Then
+ Helper.NotImplemented("Property resolution for
attribute arguments.")
+ End If
+ member = members(0)
+ Select Case member.MemberType
+ Case MemberTypes.Field
+ Dim field As FieldInfo
+ field = DirectCast(member, FieldInfo)
+
+ If m_Fields Is Nothing Then m_Fields = New
Generic.List(Of FieldInfo)
+ If m_FieldValues Is Nothing Then m_FieldValues =
New Generic.List(Of Object)
+ m_Fields.Add(field)
+
m_FieldValues.Add(item.AttributeArgumentExpression.Expression.ConstantValue)
+ Case MemberTypes.Property
+ Dim prop As PropertyInfo
+ prop = DirectCast(member, PropertyInfo)
+ If m_Properties Is Nothing Then m_Properties = New
Generic.List(Of PropertyInfo)
+ If m_PropertyValues Is Nothing Then
m_PropertyValues = New Generic.List(Of Object)
+ m_Properties.Add(prop)
+
m_PropertyValues.Add(item.AttributeArgumentExpression.Expression.ConstantValue)
+ 'm_PropertyValues.add(item.
+ Case Else
+ Helper.AddError("Invalid member type for attribute
value: " & member.MemberType.ToString)
+ End Select
+
Next
End If
@@ -187,10 +221,10 @@
End If
If m_Arguments Is Nothing Then m_Arguments = New Object() {}
- If m_Fields Is Nothing Then m_Fields = New FieldInfo() {}
- If m_FieldValues Is Nothing Then m_FieldValues = New Object() {}
- If m_Properties Is Nothing Then m_Properties = New PropertyInfo() {}
- If m_PropertyValues Is Nothing Then m_PropertyValues = New Object() {}
+ If m_Fields Is Nothing Then m_Fields = New Generic.List(Of FieldInfo)
+ If m_FieldValues Is Nothing Then m_FieldValues = New Generic.List(Of
Object)
+ If m_Properties Is Nothing Then m_Properties = New Generic.List(Of
PropertyInfo)
+ If m_PropertyValues Is Nothing Then m_PropertyValues = New
Generic.List(Of Object)
Dim ctors As ConstructorInfo()
ctors = Compiler.Helper.GetConstructors(m_ResolvedType)
@@ -210,10 +244,10 @@
Next
'If m_Arguments Is Nothing Then m_Arguments = New Object() {}
- If m_Fields Is Nothing Then m_Fields = New FieldInfo() {}
- If m_FieldValues Is Nothing Then m_FieldValues = New Object() {}
- If m_Properties Is Nothing Then m_Properties = New PropertyInfo() {}
- If m_PropertyValues Is Nothing Then m_PropertyValues = New Object() {}
+ 'If m_Fields Is Nothing Then m_Fields = New FieldInfo() {}
+ 'If m_FieldValues Is Nothing Then m_FieldValues = New Object() {}
+ 'If m_Properties Is Nothing Then m_Properties = New PropertyInfo() {}
+ 'If m_PropertyValues Is Nothing Then m_PropertyValues = New Object() {}
Return result
End Function
@@ -228,16 +262,17 @@
ElseIf m_IsModule Then
Helper.NotImplemented()
Else
- Dim memberparent As IMember = Me.FindFirstParent(Of IMember)()
+ Dim memberparent As IAttributableDeclaration =
Me.FindFirstParent(Of IAttributableDeclaration)()
If memberparent IsNot Nothing Then
Dim tp As TypeDeclaration = TryCast(memberparent,
TypeDeclaration)
Dim mthd As IMethod = TryCast(memberparent, IMethod)
Dim ctro As IConstructorMember = TryCast(memberparent,
IConstructorMember)
Dim fld As IFieldMember = TryCast(memberparent, IFieldMember)
Dim prop As PropertyDeclaration = TryCast(memberparent,
PropertyDeclaration)
+ Dim param As Parameter = TryCast(memberparent, Parameter)
If ctro IsNot Nothing Then mthd = Nothing
- Helper.Assert(tp IsNot Nothing Xor mthd IsNot Nothing Xor ctro
IsNot Nothing Xor fld IsNot Nothing Xor prop IsNot Nothing)
+ Helper.Assert(tp IsNot Nothing Xor mthd IsNot Nothing Xor ctro
IsNot Nothing Xor fld IsNot Nothing Xor prop IsNot Nothing Xor param IsNot
Nothing)
If tp IsNot Nothing Then
If tp.TypeBuilder Is Nothing Then
@@ -253,6 +288,8 @@
fld.FieldBuilder.SetCustomAttribute(GetAttributeBuilder)
ElseIf prop IsNot Nothing Then
prop.PropertyBuilder.SetCustomAttribute(GetAttributeBuilder)
+ ElseIf param IsNot Nothing Then
+
param.ParameterBuilder.SetCustomAttribute(GetAttributeBuilder)
Else
Throw New InternalException(Me)
End If
@@ -270,8 +307,8 @@
Helper.Assert(m_ResolvedTypeConstructor IsNot Nothing)
Helper.Assert(m_Arguments IsNot Nothing)
Helper.Assert(Helper.GetParameters(Compiler,
m_ResolvedTypeConstructor).Length = m_Arguments.Length)
- Helper.Assert(m_Properties IsNot Nothing AndAlso m_PropertyValues
IsNot Nothing AndAlso m_Properties.GetUpperBound(0) =
m_PropertyValues.GetUpperBound(0))
- Helper.Assert(m_Fields IsNot Nothing AndAlso m_FieldValues IsNot
Nothing AndAlso m_Fields.GetUpperBound(0) = m_FieldValues.GetUpperBound(0))
+ Helper.Assert(m_Properties IsNot Nothing AndAlso m_PropertyValues
IsNot Nothing AndAlso m_Properties.Count = m_PropertyValues.Count)
+ Helper.Assert(m_Fields IsNot Nothing AndAlso m_FieldValues IsNot
Nothing AndAlso m_Fields.Count = m_FieldValues.Count)
m_ResolvedTypeConstructor =
Helper.GetCtorOrCtorBuilder(m_ResolvedTypeConstructor)
@@ -284,7 +321,7 @@
Next
Try
- result = New CustomAttributeBuilder(m_ResolvedTypeConstructor,
m_Arguments, m_Properties, m_PropertyValues, m_Fields, m_FieldValues)
+ result = New CustomAttributeBuilder(m_ResolvedTypeConstructor,
m_Arguments, m_Properties.ToArray, m_PropertyValues.ToArray, m_Fields.ToArray,
m_FieldValues.ToArray)
Catch ex As Exception
Throw
End Try
Modified: trunk/mono-basic/vbnc/vbnc/source/Members/MethodDeclaration.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/Members/MethodDeclaration.vb
2007-03-16 21:59:53 UTC (rev 74503)
+++ trunk/mono-basic/vbnc/vbnc/source/Members/MethodDeclaration.vb
2007-03-17 00:02:24 UTC (rev 74504)
@@ -154,6 +154,11 @@
result = MyBase.GenerateCode(Info) AndAlso result
+ If Signature.Parameters IsNot Nothing Then
+ For i As Integer = 0 To Signature.Parameters.Count - 1
+ result = Signature.Parameters(i).GenerateCode(Info) AndAlso
result
+ Next
+ End If
Return result
End Function
Modified: trunk/mono-basic/vbnc/vbnc/source/Members/Parameter.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/Members/Parameter.vb 2007-03-16
21:59:53 UTC (rev 74503)
+++ trunk/mono-basic/vbnc/vbnc/source/Members/Parameter.vb 2007-03-17
00:02:24 UTC (rev 74504)
@@ -25,9 +25,9 @@
''' <remarks></remarks>
Public Class Parameter
Inherits ParsedObject
- Implements INameable, IModifiable
+ Implements INameable, IModifiable, IAttributableDeclaration
- Private m_Attributes As Attributes
+ Private m_CustomAttributes As Attributes
Private m_Modifiers As Modifiers
Private m_ParameterIdentifier As ParameterIdentifier
Private m_TypeName As TypeName
@@ -63,7 +63,7 @@
End Sub
Sub Init(ByVal Attributes As Attributes, ByVal Modifiers As Modifiers,
ByVal ParameterIdentifier As ParameterIdentifier, ByVal TypeName As TypeName,
ByVal ConstantExpression As Expression)
- m_Attributes = Attributes
+ m_CustomAttributes = Attributes
m_Modifiers = Modifiers
m_ParameterIdentifier = ParameterIdentifier
m_TypeName = TypeName
@@ -77,7 +77,7 @@
Function Clone(Optional ByVal NewParent As ParameterList = Nothing) As
Parameter
If NewParent Is Nothing Then NewParent = DirectCast(Me.Parent,
ParameterList)
Dim result As New Parameter(NewParent)
- result.m_Attributes = m_Attributes
+ result.m_CustomAttributes = m_CustomAttributes
result.m_Modifiers = m_Modifiers
result.m_ParameterIdentifier = m_ParameterIdentifier.Clone(result)
If m_TypeName IsNot Nothing Then result.m_TypeName =
m_TypeName.Clone(result)
@@ -91,9 +91,9 @@
End Get
End Property
- ReadOnly Property Attributes() As Attributes
+ ReadOnly Property CustomAttributes() As Attributes Implements
IAttributableDeclaration.CustomAttributes
Get
- Return m_Attributes
+ Return m_CustomAttributes
End Get
End Property
@@ -157,16 +157,9 @@
Throw New InternalException(Me)
End Function
- Overloads Function Define(ByVal Builder As ConstructorBuilder) As Boolean
- m_ParameterBuilder = Builder.DefineParameter(Position,
m_ParameterAttributes, Name)
- If m_ParameterBuilder.IsOptional Then
- m_ParameterBuilder.SetConstant(m_ConstantValue)
- End If
- Return True
- End Function
+ Private Function DefineInternal() As Boolean
+ Dim result As Boolean = True
- Overloads Function Define(ByVal Builder As MethodBuilder) As Boolean
- m_ParameterBuilder = Builder.DefineParameter(Position,
m_ParameterAttributes, Name)
If m_ParameterBuilder.IsOptional Then
If Helper.IsOnMS AndAlso ((Me.ParameterType.IsByRef AndAlso
m_ConstantValue IsNot Nothing) OrElse
(m_ParameterType.Equals(Compiler.TypeCache.Object) AndAlso m_ConstantValue
IsNot Nothing AndAlso m_ConstantValue.GetType.Equals(Compiler.TypeCache.Object)
= False)) Then
'HACK (a really big one...)
@@ -196,15 +189,27 @@
m_ParameterBuilder.SetCustomAttribute(cab)
End If
- Return True
+
+ Return result
End Function
+
+ Overloads Function Define(ByVal Builder As ConstructorBuilder) As Boolean
+ m_ParameterBuilder = Builder.DefineParameter(Position,
m_ParameterAttributes, Name)
+ Return DefineInternal()
+ End Function
+
+ Overloads Function Define(ByVal Builder As MethodBuilder) As Boolean
+ m_ParameterBuilder = Builder.DefineParameter(Position,
m_ParameterAttributes, Name)
+ Return DefineInternal()
+ End Function
+
Public Overrides Function ResolveCode(ByVal Info As ResolveInfo) As Boolean
Dim result As Boolean = True
Me.CheckCodeNotResolved()
- If m_Attributes IsNot Nothing Then result =
m_Attributes.ResolveCode(info) AndAlso result
+ If m_CustomAttributes IsNot Nothing Then result =
m_CustomAttributes.ResolveCode(info) AndAlso result
If m_ConstantExpression IsNot Nothing Then
result = m_ConstantExpression.ResolveExpression(info) AndAlso
result
@@ -241,7 +246,7 @@
Me.CheckTypeReferencesNotResolved()
result = Helper.ResolveTypeReferences(m_ConstantExpression,
m_TypeName, m_ParameterIdentifier) AndAlso result
- If m_Attributes IsNot Nothing Then result =
m_Attributes.ResolveTypeReferences AndAlso result
+ If m_CustomAttributes IsNot Nothing Then result =
m_CustomAttributes.ResolveTypeReferences AndAlso result
If result = False Then Return result
@@ -271,6 +276,15 @@
Return result
End Function
-
+ Friend Overrides Function GenerateCode(ByVal Info As EmitInfo) As Boolean
+ Dim result As Boolean = True
+
+ If Me.CustomAttributes IsNot Nothing Then
+ result = Me.CustomAttributes.GenerateCode(Info) AndAlso result
+ End If
+
+ Return result
+ End Function
+
End Class
Modified: trunk/mono-basic/vbnc/vbnc/source/TypeDeclarations/TypeDeclaration.vb
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/TypeDeclarations/TypeDeclaration.vb
2007-03-16 21:59:53 UTC (rev 74503)
+++ trunk/mono-basic/vbnc/vbnc/source/TypeDeclarations/TypeDeclaration.vb
2007-03-17 00:02:24 UTC (rev 74504)
@@ -55,6 +55,9 @@
Private m_BeforeFieldInit As Boolean
'Information collected during define phase.
+#If ENABLECECIL Then
+ Private m_CecilType As Mono.Cecil.TypeDefinition
+#End If
Private m_TypeBuilder As TypeBuilder
'Another hack for another bug in the ms runtime: you cannot create an
attribute when the attribute's constructor has a enum parameter and the enum
parameter is defined with a typebuilder, it only works if the enum parameter's
type is defined with an enumbuilder.
Private m_EnumBuilder As EnumBuilder
@@ -251,6 +254,14 @@
End Set
End Property
+#If ENABLECECIL Then
+ Public ReadOnly Property CecilType() As Mono.Cecil.TypeDefinition
+ Get
+ Return m_ceciltype
+ End Get
+ End Property
+#End If
+
Public Overridable Property TypeBuilder() As
System.Reflection.Emit.TypeBuilder
Get
Return m_TypeBuilder
Modified: trunk/mono-basic/vbnc/vbnc/source/vbnc.vbproj
===================================================================
--- trunk/mono-basic/vbnc/vbnc/source/vbnc.vbproj 2007-03-16 21:59:53 UTC
(rev 74503)
+++ trunk/mono-basic/vbnc/vbnc/source/vbnc.vbproj 2007-03-17 00:02:24 UTC
(rev 74504)
@@ -18,8 +18,6 @@
<DelaySign>false</DelaySign>
<OutputType>Exe</OutputType>
<OptionCompare>Binary</OptionCompare>
- <OptionExplicit>On</OptionExplicit>
- <OptionStrict>On</OptionStrict>
<RootNamespace>vbnc_ms</RootNamespace>
<StartupObject>vbnc.Main</StartupObject>
<FileUpgradeFlags>
@@ -42,6 +40,7 @@
<MapFileExtensions>false</MapFileExtensions>
<ApplicationVersion>0.0.0.0</ApplicationVersion>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <OptionStrict>On</OptionStrict>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'
">
<OutputPath>../bin/</OutputPath>
@@ -70,14 +69,12 @@
<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</DefineConstants>
+ <DefineConstants>GENERATOR,DEVGENERATOR,ENABLECECIL=false</DefineConstants>
<OutputType>Exe</OutputType>
<AssemblyName>vbnc</AssemblyName>
<RootNamespace>vbnc</RootNamespace>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
- <OptionExplicit>True</OptionExplicit>
- <OptionStrict>True</OptionStrict>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>../bin/</OutputPath>
@@ -101,8 +98,6 @@
<RootNamespace>vbnc</RootNamespace>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
- <OptionExplicit>True</OptionExplicit>
- <OptionStrict>True</OptionStrict>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Self Compile' ">
<OutputPath>../bin/</OutputPath>
@@ -130,8 +125,6 @@
<RootNamespace>vbnc</RootNamespace>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
- <OptionExplicit>True</OptionExplicit>
- <OptionStrict>True</OptionStrict>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'RuntimeTests' ">
<DebugSymbols>True</DebugSymbols>
@@ -167,47 +160,7 @@
<RootNamespace>vbnc</RootNamespace>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
- <OptionExplicit>True</OptionExplicit>
- <OptionStrict>True</OptionStrict>
</PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Self
Compile|AnyCPU' ">
- <NoWarn>
- </NoWarn>
-
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
- <DocumentationFile>vbnc_ms.xml</DocumentationFile>
- <OutputType>Exe</OutputType>
- <AssemblyName>vbnc</AssemblyName>
- <OutputPath>./</OutputPath>
- <DebugSymbols>True</DebugSymbols>
- <RootNamespace>vbnc</RootNamespace>
- <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
- <Optimize>True</Optimize>
- <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
- <DefineConstants>
- </DefineConstants>
- <WarningLevel>4</WarningLevel>
- <OptionExplicit>True</OptionExplicit>
- <OptionStrict>True</OptionStrict>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'RuntimeTests|AnyCPU' ">
- <NoWarn>
- </NoWarn>
-
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
- <DocumentationFile>vbnc_ms.xml</DocumentationFile>
- <OutputType>Exe</OutputType>
- <AssemblyName>vbnc</AssemblyName>
- <OutputPath>./</OutputPath>
- <DebugSymbols>True</DebugSymbols>
- <RootNamespace>vbnc</RootNamespace>
- <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
- <Optimize>True</Optimize>
- <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
- <DefineConstants>
- </DefineConstants>
- <WarningLevel>4</WarningLevel>
- <OptionExplicit>True</OptionExplicit>
- <OptionStrict>True</OptionStrict>
- </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
<DebugSymbols>True</DebugSymbols>
@@ -222,9 +175,9 @@
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>
</DefineConstants>
- <WarningLevel>4</WarningLevel>
- <OptionExplicit>True</OptionExplicit>
- <OptionStrict>True</OptionStrict>
+ <WarningLevel>1</WarningLevel>
+ <NoWarn>
+ </NoWarn>
</PropertyGroup>
<ItemGroup>
<Import Include="System" />
@@ -640,8 +593,8 @@
<Compile Include="General\Define.vb" />
<Compile Include="General\Defines.vb" />
<Compile Include="Emit\EmitLog.vb" />
- <!--
- <Compile Include="General\Emitter.vb" />
+ <!--
+ <Compile Include="General\Emitter.vb" />
-->
<Compile Include="General\GlobalNamespace.vb" />
<Compile Include="General\Index.IndexList.vb" />
@@ -834,10 +787,6 @@
<None
Include="ConditionalCompilation\.svn\text-base\ConditionalConstants.vb.svn-base"
/>
<None
Include="ConditionalCompilation\.svn\text-base\ConditionalExpression.vb.svn-base"
/>
<None Include="My Project\app.manifest" />
- <None Include="My Project\Application.myapp">
- <Generator>MyApplicationCodeGenerator</Generator>
- <LastGenOutput>Application.Designer.vb</LastGenOutput>
- </None>
<EmbeddedResource Include="vbnc.rsp" />
<None Include="vbnc.snk" />
</ItemGroup>
@@ -865,6 +814,12 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\..\..\..\cecil\lib\Mono.Cecil.csproj">
+ <Project>{D8F63DFF-5230-43E4-9AB2-DA6E721A1FAE}</Project>
+ <Name>Mono.Cecil</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
<Folder Include="ConditionalCompilation\.svn\props\" />
<Folder Include="ConditionalCompilation\.svn\tmp\prop-base\" />
<Folder Include="ConditionalCompilation\.svn\tmp\props\" />
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches