Commit Graph
524 Commits
Author SHA1 Message Date
Zoltan Varga 2bb04fcdbd 2008-01-29 Zoltan Varga <[email protected]>
* ModuleBuilder.cs: Fix build.

svn path=/trunk/mcs/; revision=94307
2008-01-29 19:54:30 +00:00
Zoltan Varga 538b19b760 2008-01-29 Zoltan Varga <[email protected]>
* AssemblyBuilder.cs (GetTypes): Implement this entirely in managed code.

svn path=/trunk/mcs/; revision=94302
2008-01-29 19:37:53 +00:00
Zoltan Varga 6169136e32 2008-01-29 Zoltan Varga <[email protected]>
* ModuleBuilder.cs (GetTypes): Replace TypeBuilders with their created types to
	match MS.

svn path=/trunk/mcs/; revision=94294
2008-01-29 19:15:38 +00:00
Zoltan Varga 31efbb6316 2008-01-29 Zoltan Varga <[email protected]>
* AssemblyBuilder.cs: Override GetModulesInternal () so we can return
	ModuleBuilders.

svn path=/trunk/mcs/; revision=94285
2008-01-29 18:44:28 +00:00
Zoltan Varga 558e2dc762 2008-01-25 Zoltan Varga <[email protected]>
* TypeBuilder.cs (GenerateDebugInfo): Emit debug info for nested types as well.
	Fixes #356316.

svn path=/trunk/mcs/; revision=93944
2008-01-25 18:51:40 +00:00
Gert Driesen 39737ac369 * AssemblyBuilder.cs: Introduce magic value for AssemblyBuilferAccess
to signal usage from a compiler. On 2.0 profile, perform argument
check for access. Use AssemblyFlags passed in through AssemblyName
arguments. Modified SetCustomAttribute to only use the Assembly*
attribute for constructing the assembly name when used in compiler
context. Fixes corlib part of bug #354970.
* AppDomainTest.cs: Added DefineDynamicAssembly tests for invalid
AssemblyBuilderAccess argument. Enabled test for DefineDynamicAssembly
overload taking IEnumerable<CustomAttributeBuilder>. Fixed typo in
comments.
* AssemblyBuilderTest.cs: Enabled test for bug #354970.

svn path=/trunk/mcs/; revision=93490
2008-01-22 09:26:29 +00:00
Zoltan Varga b6da4e2641 2008-01-17 Zoltan Varga <[email protected]>
* TypeBuilder.cs (GetConstructorImpl): Add back the code removed by the last
	patch since it is needed when building mscorlib.

svn path=/trunk/mcs/; revision=93180
2008-01-17 17:56:30 +00:00
Gert Driesen 3b1acfb662 * TypeBuilder.cs (GetConstructorImpl): Use GetConstructor on created
type. Original implementation did not take into account the binding
flags and failed with a NotSupportedException if the default binder
checked if a ParamArrayAttribute was defined. It also does not make
sense to return a ConstructorBuilder once the type is emitted.
(GetConstructors): When the type is emitted, use GetConstructors
on the created type.
(GetFields): Removed duplicate code.
(GetMethodsByName): Fixed matching of methods in the parent class
depending on their accessibility:
- Private: never include private methods of parent
- Public: ignore if Public flag is not set
- Assembly: ignore if NonPublic is not set or when on the 1.0 profile
- Rest (Family, FamANDAssem, FamORAssem): ignore if NonPublic flag is
not set
Static methods of the parent are ignored unless the FlattenHierarchy
flag is set.
(GetProperties): When the type is emitted, use GetProperties on the
created type as the TypeBuilder implementation itself does not include
properties from the parent class.
* TypeBuilderTest.cs: Enabled tests for bug #322762.

svn path=/trunk/mcs/; revision=93080
2008-01-16 19:00:34 +00:00
Gert Driesen 75fa72c63c * AssemblyBuilder.cs (UnprotectedGetName): Set the public key token
as well.
* AssemblyBuilderTest.cs: Improved existing AssemblyName related tests.
Enabled AssemblyName tests that previously failed.
* AssemblyNameCas.cs: Sync test methods with AssemblyNameTest.cs.
* AssemblyNameTest.cs: Removed AssertEqualsByteArrays method since
NUnit supports this out-of-the-box. Use more meaningful names for
some existing tests. Improved existing tests and added lots more.
Enabled tests that were previously failing.  Fixed and improved
tests for public key; the original "public key" was actually a         
key pair.
* AssemblyName.cs: Fixed default value for ProcessorArchitecture to
match MS. On 2.0 profile, return zero-length in FullName is no name
is set, and throw a SecurityException in FullName and GetPublicKeyToken
if a public key is set with no corresponding public key token. 
Fixed FullName to also include PublicKeyToken spec with "null" value
if public key is empty byte array. Fixed corlib part of bug #351057.   
In SetPublicKey, modify Flags accordingly. On the 2.0 profile, verify
the public key when the public key token is computed.

svn path=/trunk/mcs/; revision=92314
2008-01-05 19:35:02 +00:00
Zoltan Varga 23a482c0f9 2007-12-10 Zoltan Varga <[email protected]>
* FieldBuilder.cs (GetToken): Use the MetadataToken property.

svn path=/trunk/mcs/; revision=91064
2007-12-10 21:18:37 +00:00
Atsushi Eno 242bf8b8ea 2007-11-20 Atsushi Enomoto <[email protected]>
* GenericTypeParameterBuilder.cs : fixed regression.
          GenericParameterAttributes also needs some special care.


svn path=/trunk/mcs/; revision=90008
2007-11-20 18:13:33 +00:00
Atsushi Eno 7db700987c 2007-11-20 Atsushi Enomoto <[email protected]>
* MethodBuilder.cs : implemented ContainsGenericParameters().
        * GenericTypeParameterBuilder.cs : removed most of extra members
          and added missing members for 2.0 API.


svn path=/trunk/mcs/; revision=89964
2007-11-20 06:53:21 +00:00
Miguel de Icaza 94f0248122 2007-11-18 Miguel de Icaza <[email protected]>
* SignatureHelper.cs: Implement Equals and GetHashCode



svn path=/trunk/mcs/; revision=89881
2007-11-18 05:01:04 +00:00
Miguel de Icaza fdd5d5d2dd Fix growth and validation; Have a test case, but it generates junk
svn path=/trunk/mcs/; revision=89874
2007-11-17 21:21:42 +00:00
Miguel de Icaza 4b075a596f 2007-11-17 Miguel de Icaza <[email protected]>
* SignatureHelper.cs: Preparational tasks to support the
	AddArgument overloads that allow the specification of modopts and
	modreqs. 

	Refactor code, add new parameters. 


svn path=/trunk/mcs/; revision=89871
2007-11-17 20:01:57 +00:00
Miguel de Icaza a770504240 2007-11-17 Miguel de Icaza <[email protected]>
* SignatureHelper.cs (AddArguments): Add new 2.0 API, used by
	new versions of the DLR.   Currently does not have support for
	modreq, modopts.   Just a simple wrapper as consumed by the DLR.

svn path=/trunk/mcs/; revision=89856
2007-11-17 16:13:07 +00:00
Atsushi Eno eabd01c6bd 2007-11-16 Atsushi Enomoto <[email protected]>
* AssemblyBuilder.cs : added missing 2.0 member.
        * DynamicMethod.cs : removed extra stuff.
        * DynamicILInfo.cs : no public .ctor().
        * ILGenerator.cs : fixed 2.0 member signatures.


svn path=/trunk/mcs/; revision=89786
2007-11-16 19:51:37 +00:00
Atsushi Eno de48dbe3f6 2007-11-16 Atsushi Enomoto <[email protected]>
* EnumBuilder.cs, TypeBuilder.cs : implemented missing 2.0
          stuff, in harmless manner.


svn path=/trunk/mcs/; revision=89779
2007-11-16 18:59:56 +00:00
Atsushi Eno 268ad074d2 2007-11-16 Atsushi Enomoto <[email protected]>
* ConstructorBuilder.cs : added CallingConvention.


svn path=/trunk/mcs/; revision=89775
2007-11-16 18:33:00 +00:00
Atsushi Eno c5d9e71c0a 2007-11-16 Atsushi Enomoto <[email protected]>
* SignatureHelper.cs : Module can be null, and for non-
          ModuleBuilder argument, throw ArgumentException.
          Added missing 2.0 stuff.

        * SignatureHelperTest.cs : new test.

        * corlib_test.dll.sources : added S.R.E/SignatureHelperTest.cs.


svn path=/trunk/mcs/; revision=89774
2007-11-16 17:50:33 +00:00
Rodrigo Kumpera c50d321084 2007-11-08 Rodrigo Kumpera <[email protected]>
* TypeBuilder.cs: Workaround for #82625 not needed anymore.
	GetFields() returns the created type fields.


svn path=/trunk/mcs/; revision=89189
2007-11-08 14:22:49 +00:00
Gert Driesen 5355f97836 * ILGenerator.cs: Added missing null checks. Removed extra tabs.
* ILGeneratorTest.cs: Improve test for DeclareLocal null check.
Added tests for null checks in Emit overloads.

svn path=/trunk/mcs/; revision=87476
2007-10-15 08:13:33 +00:00
Gert Driesen 19f6a68a50 * AssemblyTest.cs: Added test for ManifestModule.
* AssemblyBuilderTest.cs: Added test for ManifestModule. Added missing
Test attributes. Avoid using ExpectedException, thereby improving lots
of existing tests. Uncomment test that checks max length of dynamic
module name and removed LAMESPEC, since MS implements the described 
behavior (but we don't, so mark it NotWorking). Code formatting.
* TypeBuilderTest.cs: Removed unused variables.
* AssemblyBuilder.cs: Added missing paramname to ArgumentExceptions.
Use String.Length to check for zero-length string.

svn path=/trunk/mcs/; revision=86236
2007-09-23 09:39:35 +00:00
Zoltan Varga 2e70d02e59 2007-09-23 Zoltan Varga <[email protected]>
* AssemblyBuilder.cs (GetManifestModule): Return a ModuleBuilder here to
	match MS.NET.

svn path=/trunk/mcs/; revision=86225
2007-09-22 23:39:01 +00:00
Gert Driesen e69bd82d01 * TypeBuilder.cs: Added test for bug #327484. Split up and improved
TestGetProperties(Flags)Incomplete and TestGetMethods(Flags)Incomplete
ests. Improved TestGetMethodsComplete test.
* TypeBuilder.cs: Do not include static methods of base class in
GetMethod(s). Fixes bug #327482.

svn path=/trunk/mcs/; revision=86211
2007-09-22 15:46:38 +00:00
Zoltan Varga 51df3ac0a6 2007-09-14 Zoltan Varga <[email protected]>
* AssemblyBuilder.cs (DefineVersionInfoResource): Allow the arguments to be
	null. Fixes #82832.

svn path=/trunk/mcs/; revision=85807
2007-09-14 14:49:19 +00:00
Jb Evain cee45471f8 2007-09-11 Jb Evain <[email protected]>
* DynamicMethod.cs: store the owner of the DynamicMethod.

svn path=/trunk/mcs/; revision=85660
2007-09-11 20:51:10 +00:00
Zoltan Varga 05cb1c80ab 2007-09-09 Zoltan Varga <[email protected]>
* AssemblyBuilder.cs (DefineUnmanagedResource): Open file read-only. Fixes
	#72764.

svn path=/trunk/mcs/; revision=85537
2007-09-09 20:26:52 +00:00
Jb Evain 7c109459cf preserve the old behavior for 1.1 profiles
svn path=/trunk/mcs/; revision=85190
2007-09-02 11:58:08 +00:00
Jb Evain ee57bc5381 fix 1.1 profiles
svn path=/trunk/mcs/; revision=85188
2007-09-02 11:39:28 +00:00
Zoltan Varga 95da7d075c 2007-09-02 Zoltan Varga <[email protected]>
* TypeBuilder.cs: Add a workaround for #82625 to make nemerle work again.

svn path=/trunk/mcs/; revision=85182
2007-09-02 09:26:38 +00:00
Gert Driesen beb9cf95b6 * AssemblyBuilder.cs: In DefineIconResource, open icon in read-only
mode. Fixes bug #82617.

svn path=/trunk/mcs/; revision=85008
2007-08-29 16:36:41 +00:00
Rolf Bjarne Kvinge d77caf4c86 In System.Reflection.Emit:
2007-08-17  Rolf Bjarne Kvinge  <[email protected]>

	* ILGenerator.cs: Change BeginCatchBlock to end the current filter block if called with a null exceptionType. Added ILExceptionBlock.FILTER_START to be able to track if we're in a filter block or not. Renamed PatchLastClauseStart to PatchFilterClause to match better what it does, and make it update the handler's type to FILTER. Fixes #81431.

In Test/System.Reflection.Emit:
2007-08-17  Rolf Bjarne Kvinge  <[email protected]>

	* ILGeneratorTest.cs: Added FilterAndCatchBlock (bug #81431), InvalidFilterBlock1, ValidFilterBlock1, ValidFilterBlock2.


svn path=/trunk/mcs/; revision=84262
2007-08-17 09:12:13 +00:00
Sebastien Pouliot 68077f5398 fix build
svn path=/trunk/mcs/; revision=83824
2007-08-10 14:54:49 +00:00
Zoltan Varga 2c21ca2b5d 2007-08-10 Zoltan Varga <[email protected]>
* DynamicILInfo.cs: New file.

	* DynamicMethod.cs (GetDynamicILInfo): New 2.0 method.

svn path=/trunk/mcs/; revision=83814
2007-08-10 12:59:21 +00:00
Rodrigo Kumpera 27856eec2c In System.Reflection.Emit:
2007-07-11  Rodrigo Kumpera <[email protected]>

	* TypeBuilder.cs (CreateType): method did not check for enum type with defined methods and fixed compatibility issue in case of calling CreateType again after the first one failed, it now returns null as well.

In Test/System.Reflection.Emit:
2007-07-11  Rodrigo Kumpera  <[email protected]>

	* TypeBuilderTest.cs: Added tests for enum creation. These tests are related to bugs #82018 and #82075


svn path=/trunk/mcs/; revision=81829
2007-07-11 19:52:35 +00:00
Zoltan Varga 796a1a218b 2007-07-10 Zoltan Varga <[email protected]>
* OpCodeType.cs EventToken.cs FieldToken.cs SignatureToken.cs PackingSize.cs
	StringToken.cs AssemblyBuilderAccess.cs FlowControl.cs MethodToken.cs
	ParameterToken.cs TypeToken.cs PropertyToken.cs OperandType.cs PEFileKinds.cs
	StackBehaviour.cs: 2.0 updates.

svn path=/trunk/mcs/; revision=81640
2007-07-09 13:32:03 +00:00
Gert Driesen d7ff8098f7 * MethodBuilder.cs: Code formatting. Spaces to tabs.
* TypeBuilder.cs: Same.

svn path=/trunk/mcs/; revision=81553
2007-07-07 14:31:09 +00:00
Gert Driesen bfc21a03d0 * TypeBuilder.cs: Throw InvalidOperationException when attempting to
construct non-abstract interface without base type. Modified SetParent  
to match MS: in 2.0 profile, throw InvalidOperationException when 
parent is null and TypeBuilder is non-abstract interface. When 
parent is null and TypeBuilder is not an interface, then set object
as parent. In 1.0 profile, throw ArgumentNullException when parent is
null.
* TypeBuilderTest.cs: Improved tests for SetParent.
* ModuleBuilderTest.cs: Added test for creating non-abstract
interface.

svn path=/trunk/mcs/; revision=81476
2007-07-06 14:38:44 +00:00
Gert Driesen e37be65437 * TypeBuilder.cs: Implemented IsCOMObjectImpl.
* TypeBuilderTest.cs: Enabled test for IsCOMObject. Improved test
for IsImport.
* TypeTest.cs: Added tests for IsAbstract, IsCOMObject, IsImport,
IsInterface, IsPrimitive and IsValueType.

svn path=/trunk/mcs/; revision=81465
2007-07-06 12:10:23 +00:00
Atsushi Eno 63b76a58b7 oops, it is S.R.E, not S.R.
2007-07-04  Atsushi Enomoto  <[email protected]>

	* DynamicMethod.cs : 2.0 API fix.


svn path=/trunk/mcs/; revision=81312
2007-07-04 02:21:10 +00:00
Zoltan Varga 361bc61c72 2007-06-21 Zoltan Varga <[email protected]>
* DynamicMethod.cs: Applied patch from Robert Jordan ([email protected]). Add
	a destructor which frees the runtime data for the method.

svn path=/trunk/mcs/; revision=80498
2007-06-21 17:31:47 +00:00
Gert Driesen 3b44a4eb76 * MethodBuilderTest.cs: Split up GetCustomAttributes test and marked
the one for a baked type as NotWorking. Added test for 
SetCustomAttribute with SuppressUnmanagedCodeSecurity attribute.
* TypeBuilderTest.cs: Split up HasElementType test and marked the 
baked variant as NotWorking on the 1.0 profile. Enabled additional
test for bug #81640. Added test for SetCustomAttribute with
SuppressUnmanagedCodeSecurity attribute.
* TypeBuilder.cs: Changed HasElementTypeImpl to return false on 2.0
profile when type is not baked.

svn path=/trunk/mcs/; revision=77776
2007-05-21 18:54:02 +00:00
Jb Evain a461af89d0 oops, fix the build
svn path=/trunk/mcs/; revision=77765
2007-05-21 14:40:09 +00:00
Jb Evain 7a9f4ed6b9 2007-05-21 Jb Evain <[email protected]>
* TypeBuilder.cs
	  MethodBuilder.cs:
		Tag methods and types as HasSecurity when adding a
		SuppressUnmanagedCodeSecurityAttribute on them.
		Makes peverify happy.

svn path=/trunk/mcs/; revision=77762
2007-05-21 14:21:23 +00:00
Gert Driesen a1de2b9aee * TypeBuilder.cs (GetField): Return MonoField instance if the type is
already created. Fixed other part of bug #81368.
* TypeBuilderTest.cs: Added GetFields test for bug #81368. Enabled
test for bug #81640.

svn path=/trunk/mcs/; revision=77508
2007-05-16 20:01:49 +00:00
Zoltan Varga bd4b2d9696 2007-05-16 Zoltan Varga <[email protected]>
* TypeBuilder.cs (GetFields): Return MonoField objects if the type is already
	created.

	* FieldBuilder.cs (SetValue): Make this not supported again.

svn path=/trunk/mcs/; revision=77505
2007-05-16 19:27:47 +00:00
Zoltan Varga a500d858de 2007-05-16 Zoltan Varga <[email protected]>
* FieldBuilder.cs: Support calling SetValue (). Fixes #81638.

svn path=/trunk/mcs/; revision=77476
2007-05-16 12:54:35 +00:00
Zoltan Varga af12cc2533 2007-05-06 Zoltan Varga <[email protected]>
* TypeBuilder.cs (CreateType): Fix build.

svn path=/trunk/mcs/; revision=76773
2007-05-06 12:23:33 +00:00
Zoltan Varga 2a72ad0be4 2007-05-06 Zoltan Varga <[email protected]>
* TypeBuilder.cs (.ctor): Convert null parent to typeof (object). Fixes #81530.

	* TypeBuilder.cs (UnderlyingSystemType): Remove commented out code.

svn path=/trunk/mcs/; revision=76762
2007-05-05 23:18:35 +00:00