Преглед на файлове

2002-06-07 Martin Baulig <[email protected]>

	* TypeBuilder.cs (TypeBuilder): Added `PackingSize packing_size' and
	`int type_size' fields to the constructor.
	(DefineNestedType): Pass packing_size and type_size to the constructor.

	* ModuleBuilder.cs (DefineType): Pass the packing_size and type_size
	fields to the TypeBuilder's constructor.

svn path=/trunk/mcs/; revision=5160
Martin Baulig преди 23 години
родител
ревизия
fac61b26e5

+ 9 - 0
mcs/class/corlib/System.Reflection.Emit/ChangeLog

@@ -1,3 +1,12 @@
+2002-06-07  Martin Baulig  <[email protected]>
+
+	* TypeBuilder.cs (TypeBuilder): Added `PackingSize packing_size' and
+	`int type_size' fields to the constructor.
+	(DefineNestedType): Pass packing_size and type_size to the constructor.
+
+	* ModuleBuilder.cs (DefineType): Pass the packing_size and type_size
+	fields to the TypeBuilder's constructor.
+
 2002-06-07  Martin Baulig  <[email protected]>
 
 	* TypeBuilder.cs (DefineNestedType): There is no overload for this

+ 9 - 5
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs

@@ -132,8 +132,8 @@ namespace System.Reflection.Emit {
 			return DefineType (name, attr, parent, null);
 		}
 
-		public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
-			TypeBuilder res = new TypeBuilder (this, name, attr, parent, interfaces);
+		private TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packsize, int typesize) {
+			TypeBuilder res = new TypeBuilder (this, name, attr, parent, interfaces, packsize, typesize);
 			if (types != null) {
 				TypeBuilder[] new_types = new TypeBuilder [types.Length + 1];
 				System.Array.Copy (types, new_types, types.Length);
@@ -147,16 +147,20 @@ namespace System.Reflection.Emit {
 			return res;
 		}
 
+		public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
+			return DefineType (name, attr, parent, interfaces, PackingSize.Unspecified, TypeBuilder.UnspecifiedTypeSize);
+		}
+
 		public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, int typesize) {
-			return DefineType (name, attr, parent, null);
+			return DefineType (name, attr, parent, null, PackingSize.Unspecified, TypeBuilder.UnspecifiedTypeSize);
 		}
 
 		public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, PackingSize packsize) {
-			return DefineType (name, attr, parent, null);
+			return DefineType (name, attr, parent, null, packsize, TypeBuilder.UnspecifiedTypeSize);
 		}
 
 		public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, PackingSize packsize, int typesize) {
-			return DefineType (name, attr, parent, null);
+			return DefineType (name, attr, parent, null, packsize, typesize);
 		}
 
 		public MethodInfo GetArrayMethod( Type arrayClass, string methodName, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {

+ 12 - 6
mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs

@@ -48,11 +48,12 @@ namespace System.Reflection.Emit {
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
 		private extern void create_internal_class (TypeBuilder tb);
 		
-		internal TypeBuilder (ModuleBuilder mb, string name, TypeAttributes attr, Type parent, Type[] interfaces) {
+		internal TypeBuilder (ModuleBuilder mb, string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packing_size, int type_size) {
 			int sep_index;
 			this.parent = parent;
 			this.attrs = attr;
-			packing_size = PackingSize.Unspecified;
+			this.class_size = type_size;
+			this.packing_size = packing_size;
 			sep_index = name.LastIndexOf('.');
 			if (sep_index != -1) {
 				this.tname = name.Substring (sep_index + 1);
@@ -161,8 +162,8 @@ namespace System.Reflection.Emit {
 			return DefineNestedType (name, attr, parent, null);
 		}
 
-		public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
-			TypeBuilder res = new TypeBuilder (pmodule, name, attr, parent, interfaces);
+		private TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packsize, int typesize) {
+			TypeBuilder res = new TypeBuilder (pmodule, name, attr, parent, interfaces, packsize, typesize);
 			if (subtypes != null) {
 				TypeBuilder[] new_types = new TypeBuilder [subtypes.Length + 1];
 				System.Array.Copy (subtypes, new_types, subtypes.Length);
@@ -175,12 +176,16 @@ namespace System.Reflection.Emit {
 			return res;
 		}
 
+		public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
+			return DefineNestedType (name, attr, parent, interfaces, PackingSize.Unspecified, UnspecifiedTypeSize);
+		}
+
 		public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, int typesize) {
-			return DefineNestedType (name, attr, parent, null);
+			return DefineNestedType (name, attr, parent, null, PackingSize.Unspecified, typesize);
 		}
 
 		public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, PackingSize packsize) {
-			return DefineNestedType (name, attr, parent, null);
+			return DefineNestedType (name, attr, parent, null, packsize, UnspecifiedTypeSize);
 		}
 
 		public ConstructorBuilder DefineConstructor( MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes) {
@@ -288,6 +293,7 @@ namespace System.Reflection.Emit {
 					ctor.fixup ();
 				}
 			}
+
 			return this;
 		}