Commit Graph
92 Commits
Author SHA1 Message Date
Marek Safar c0567c50b8 [ilasm] Fixes forwarded types namespace encoding 2013-11-14 16:26:58 +01:00
Marek Safar 8d69f23de4 Implement .extern class support for forwarded types 2012-11-21 13:15:43 +01:00
QuickJack 945c2a7433 Fixes some warnings in PEAPI.dll 2011-12-29 13:54:31 +01:00
Ankit Jain 7669023479 * PEAPI.cs (PEFile.GetNextSectStart): Handle the case when (tide %
SectionAlignment) == 0 . Patch by Carlo Kok. Fixes bug #78182.

svn path=/trunk/mcs/; revision=61555
2006-06-08 09:28:06 +00:00
Ankit Jain dae78680fd In ilasm/tests:
* test-cattr-1.il: New. Test for custom attributes on return type of
	a method.

In ilasm/codegen:

	* MethodDef.cs (MethodDef): Use a ParamDef for return type, instead of a
	BaseTypeRef.
	(MethodDef.ctor): Update.
	(MethodDef.AddParamDefaultValue): Remove.
	(MethodDef.GetParam): Likewise.
	(MethodDef.Resolve): Update to use ret_param instead of ret_type.

In ilasm/errors:

	* err-cattr.il: New.

In ilasm/parser:

	* ILParser.jay (method_decl | D_PARAM ..): Param index is zero-based,
	with zero representing the return value.
	Update to check CurrentCustomAttrTarget for null before using it.

In class/PEAPI:

	* PEAPI.cs (PEFile.AddMethod): Add overload for return type as Param
	instead of PEAPI.Type .
	* Metadata.cs (MetaDataElement.HasCustomAttr): New. Temporary hack.
	(Param.HasMarshalInfo): New.
	(ClassDef.AddMethod): Add overload for return type as Param.
	(MethodDef.ctor): Change internal .ctor's sig to take Param instead of
	PEAPI.Type for return type.
	(MethodDef.retType): Remove.
	(MethodDef.TypeSig): Update to use ret_param always.
	(MethodDef.BuildTables): Add ret_param to Param table only if it has
	marshal info or custom attributes.

svn path=/trunk/mcs/; revision=61358
2006-06-01 09:33:05 +00:00
Ankit Jain c366948a9b Add support or 2.0 style declarative security attributes.
In ilasm/tests:

	* test-perm_pass-3.il: New. Test for 2.0 style declarative security
	attributes.

In ilasm/codegen:

	* PermissionSet.cs: New.
	* Permission.cs: New.
	* PermissionMember.cs: New. Classes for 2.0 metadata format of
	declarative security.

	* DeclSecurity.cs (DeclSecurity.AddPermissionSet): New. Overload for new
	PermissionSet class.
	(DeclSecurity.AddTo): Add new style PermissionSets also.
	* CodeGen.cs (CodeGen.AddPermisson): Handle new PermissionSets also.
	* ExternTable.cs (ExternAssembly.AssemblyName): New.

In ilasm/scanner:

	*  ILTables.cs (keywords): Move 'property' out of NET_2_0 .

In ilasm/parser:
	
	Add support or 2.0 style declarative security attributes.
	* ILParser.jay (primitive_type): New. Extracted from 'type'.
	(field_init_primitive): New. Extracted from 'field_init', with all
	primitive types.
	(sec_decl | ..): New rule for 2.0 style permissions.

	(permissions):
	(permission):
	(permission_members):
	(permission_member):
	(perm_mbr_nameval_pair):
	(prop_or_field): New rules for 2.0 style permissions.

	(AddSecDecl): New.

In class/PEAPI:

	* Metadata.cs (DeclSecurity): Rename to .. 
	(BaseDeclSecurity): .. this.
	(DeclSecurity): New. Derive from BaseDeclSecurity.
	(DeclSecurity_20): Likewise. For 2.0 style declaritive security.
	(PermissionSet): New.
	(Permission): New.
	(PermissionMember): New.
	(MetaData.AddDeclSecurity): Update to use BaseDeclSecurity.
	(MetaData.BuildMetaData): Likewise.	
			   
	* PEAPI.cs (PEFile.AddDeclSecurity): New overload for new PermissionSet
	class.


svn path=/trunk/mcs/; revision=61158
2006-05-26 10:43:30 +00:00
Ankit Jain d681944640 svn path=/trunk/mcs/; revision=59796 2006-04-24 08:34:01 +00:00
Ankit Jain 37ae586933 Display error messages instead of stack traces.
In ilasm/codegen:
2006-02-20  Ankit Jain  <[email protected]>

	* *.cs: Update all .cs files to use Report.Error instead of directly
	throwing an exception.
	* CodeGen.cs (CodeGen.ctor): Remove 'report' param, and the related
	field & property.

In ilasm:
2006-02-20  Ankit Jain  <[email protected]>

	* Report.cs (Report): Make all methods,fields static.
	(Report.Error): Update to throw ILAsmException.
	(ILAsmException): New.
	(InternalErrorException): New. Derive from ILAsmException.
	* Driver.cs (Driver.Run): Catch ILAsmException and PEFileException and
	print error messages instead of dumping the stack trace, and delete the
	output file if CodeGen.Write() fails.
	Move the check for entrypoint from CodeGen.Write to here.

In ilasm/scanner:
2006-02-20  Ankit Jain  <[email protected]>

	* ILTokenizingException.cs (ILTokenizingException): Derive from
	ILAsmException.

In ilasm/parser:
2006-02-20  Ankit Jain  <[email protected]>

	* ILParser.jay: Update to use Report.Error instead of directly throwing
	an exception.

In class/PEAPI:
2006-02-20  Ankit Jain  <[email protected]>

	* PEAPI.cs (PEFileException): Update error message.
	* Metadata.cs: Update to throw PEFileException instead of Exception.     


svn path=/trunk/mcs/; revision=57063
2006-02-20 12:31:13 +00:00
Ankit Jain c11b7068c0 In ilasm/parser:
* ILParser.jay (type | BANG ..): Move !* and !!* rules to ..
	(generic_class_ref): ..this, to allow using VAR/MVARs as class refs.
	Eg. "extends !0"

In class/PEAPI:

	* Metadata.cs (GenParam): Don't use GetTypeSpec to create typespec for GenParam. 
	Adding required methods directly to GenParam.
	* PEAPI.cs (PEFile.AddGenericParam): Add it to the TypeSpec table directly.

svn path=/trunk/mcs/; revision=55306
2006-01-10 16:38:08 +00:00
Ankit Jain e27a1b02bc In ilasm/codegen:
* GenericTypeRef.cs: Rename to ..
	* GenericParamRef.cs: .. this.
	(IGenericTypeRef): New.
	(GenericParamRef): Implement IGenericTypeRef.
	* GenericTypeInst.cs (GenericTypeInst): Implement IGenericTypeRef instead
	of IClassRef.
	(GenericTypeInst.ResolveOnly): Rename to ResolveNoTypeSpec to implement
	IGenericTypeRef.ResolveNoTypeSpec .
	* MethodDef.cs (MethodDef.ResolveGenParams): Update to use GenericParamRef.
	* Local.cs (Local.GetPeapiLocal): Use IGenericTypeRef.

In ilasm:

        * ilasm.exe.sources: Replace GenericTypeRef.cs with GenericParamRef.cs

In ilasm/parser:

        * ILParser.jay: Update to use GenericParamRef instead of GenericTypeRef.

In class/PEAPI:

	* PEAPI.cs (PEFile.AddGenricParam): New. Adds a GenParam to the TypeSpec
	table.
	* Metadata.cs (GenParam): Inherit from 'Class' instead of 'Type'.
	(GenParam.name): Rename to param_name as it hides Class.name .
	(GenParam.GetTypeSpec): Override to create TypeSpec for genparam.


svn path=/trunk/mcs/; revision=55238
2006-01-09 16:12:24 +00:00
Ankit Jain 44dff0d712 In ilasm/codegen:
* IClassRef.cs (IClassRef.Clone): New.
	(IClassRef.GetGenericTypeInst): Get the Generic Instance of the IClassRef.
	(IClassRef.ResolveInstance): Resolves the generic instance and returns the
	resolved PEAPI type.     

	* TypeRef.cs:
	* ExternTypeRef.cs: Implement new methods of IClassRef.
	Classes implementing IClassRef cache their generic instances (GenericTypeInst)
	and their corresponding resolved PEAPI types.

	* CodeGen.cs (CodeGen.GetTypeRef): Gets a TypeRef given a type name and caches them.

	GenericTypeInst is now used for any Generic Type Instance, including any
	extern types. ExternTypeRefInst is not used now.
	* GenericTypeInst.cs (GenericTypeInst): Implement IClassRef instead of ITypeRef.
	(GenericTypeInst.ResolveAsClass): Adds the instance to the TypeSpec table after Resolve()'ing it.
	Clone () returns a cloned instance which shares its class_ref and generic arguments.

	* TypeDef.cs (TypeDef.Define): Use ResolveAsClass for base class and interfaces
	being implemented if they are GenericTypeInsts.

In ilasm:

	* ilasm.exe.sources: Remove ExternTypeRefInst from build.

In ilasm/parser:

	* ILParser.jay (GetTypeRef): Use new IClassRef.Clone .
	(extends_clause): Use new IClassRef.GetGenericTypeInst.
	(impl_clause | K_IMPLEMENTS class_refs): Remove.
	(impl_clause | impl_class_refs): New.
	(impl_class_refs): New. Add rules for generic and non-generic interface
	implementations.
	(class_ref | slashed_name): Use new codegen.GetTypeRef so that the TypeRef 
	gets cached.
	(type | K_CLASS class_ref): Add typars_clause to the rule and handle accordingly.
	(type | K_VALUETYPE ...): Likewise.

In class/PEAPI:

	* PEAPI.cs (PEFile.AddGenericClass): New. Adds a GenericTypeInst to the TypeSpec table.
	* Metadata.cs (GenericTypeInst): Change base class from 'Type' to 'Class'.
	(GenericTypeInst.GetTypeSpec):
	(GenericTypeInst.BuildTables):
	(GenericTypeInst.Size):
	(GenericTypeInst.Write):
	(GenericTypeInst.GetCodedIx): Implement these for GenericTypeInst.
	(ClassDef.SetSuper): Set typeIndexChecked to false if 'super' is not GenericTypeInst.
	Fixup of typeIndex is not required for GenericTypeInst .     
	(ClassDef.CheckTypeIndex): Recursively fix typeIndex if superType is ClassDef.
	(MetaData.BuildMetaData): BuildTable for TypeSpec.


svn path=/trunk/mcs/; revision=55094
2006-01-05 11:29:58 +00:00
Ankit Jain 3a0beb268e In ilasm/codegen:
2005-12-09  Ankit Jain  <[email protected]>

	* ITypeRef.cs (ITypeRef.GetMethodRef): Add 'gen_param_count' param.
	* Sentinel.cs (Sentinel.GetMethodRef): Update.
	* GlobalMethodRef.cs (GlobalMethodRef.ctor): Add 'gen_param_count' param.
	(GlobalMethodRef.Resolve): Update usage of MethodDef.CreateSignature .
	* TypeDef.cs (TypeDef.GetGenericParamNum): New.
	(TypeDef.DefineContents): Update usage of ITypeRef.GetMethodRef .
	* ExternTypeRefInst.cs (ExternTypeRefInst.ctor): Add parameter for list of type
	parameters (type_list).
	(ExternTypeRefInst.Clone): Clone type_list also.
	(ExternTypeRefInst.Resolve): Resolve the list of type parameters, and create
	instance of PEAPI.GenericTypeInst instead of PEAPI.ClassRefInst .
	(ExternTypeRefInst.GetMethodRef): Update.
	* GenericTypeInst.cs (GenericTypeInst.GetMethodRef): Update signature. Update
	usage of TypeSpecMethodRef.ctor .
	* MethodRef.cs (MethodRef.ctor): Add 'gen_param_count' param.
	(MethodRef.Resolve): Throw exception for non-existant owner. Update usage of
	MethodDef.CreateSignature .
	* ExternMethodRef.cs (ExternMethodRef.ctor): Add 'gen_param_count' param.
	(ExternMethodRef.Resolve): Update usage of PEFile.AddMethodToTypeSpec and .AddMethod
	* GenericMethodRef.cs (GenericMethodRef.PeapiMethod): Return PEAPI.Method obtained in 
	.Resolve .
	* GenericTypeRef.cs (GenericTypeRef.GetMethodRef): Update.
	* MethodPointerTypeRef.cs (MethodPointerTypeRef.GetMethodRef): Likewise.
	* TypeSpecMethodRef.cs (TypeSpecMethodRef.ctor): Add 'gen_param_count' param.
	(TypeSpecMethodRef.Resolve): Update usage of PEFile.AddMethodToTypeSpec .
	* MethodDef.cs (MethodDef.ctor): Add 'typars_list' param.
	(MethodDef.AddGenericParam): Replace .. 
	(MethodDef.AddGenericParams): .. with this.
	(MethodDef.GenParamCount): New.
	(MethodDef.GetGenericParamNum): New. Returns index for a given method type parameter name.
	(MethodDef.ResolveGenParams): Resolves type parameter names in the parameter
	list to their corresponding indices.
	(MethodDef.ResolveGenParam): Resolves a give type parameter to its corresponding
	index.
	(MethodDef.CreateSignature): Add 'gen_param_count' param.
	* TypeRef.cs (TypeRef.GetMethodRef): Update.
	* ExternTypeRef.cs (ExternTypeRef.GetMethodRef): Likewise.
	* PrimitiveTypeRef.cs (PrimitiveTypeRef.GetMethodRef): Likewise.

In ilasm/parser:
2005-12-09  Ankit Jain  <[email protected]>

	* ILParser.jay (class_decl | D_OVERRIDE ..): Update usage of ITypeRef.GetMethodRef 
	and MethodDef.CreateSignature .
	(method_head | D_METHOD ..): Update usage of MethodDef.ctor .
	Use MethodDef.ResolveGenParams to resolve VARs/MVARs in parameter list.
	(type | K_CLASS slashed_name ..): Remove redundant rule.
	(type | BANG id): New. Generic type parameter.
	(type | BANG BANG id): New. Generic method type parameter.
	(instr | INSTR_FIELD type ..): Resolve generic param for 'type'.
	(method_ref | call_conv ..): Set MethodRef's GenParamCount.
	(method_ref | call_conv type ..): Update usage of TypeSpecMethodRef.ctor and GetMethodRef.
	(method_ref | call_conv type ..): New. Rule for global generic method refs.
	(custom_type | call_conv ..): Update usage of GlobalMethodRef.ctor .

In class/PEAPI:
2005-12-09  Ankit Jain  <[email protected]>

	* Metadata.cs (Method.ctor): Remove rType parameter.
	(Method.GetRetType): Remove.
	(Method.AddCallConv): Make it abstract.
	(Method.GetSigIx): Likewise.
	(MethodDef): Override and implement abstract methods from Method class.
	(MethodRef): Likewise.
	(MethodSpec): Change base class from MetaDataElement to Method. Override 
	abstract methods from Method but throw Exception as they are not meant to be used here.
	(MethodDef.TypeSig): Write gen_param_count before num of params.
	(ClassRef.AddMethod): New overload with an extra gen_param_count param.
	* PEAPI.cs (PEFile.AddMethodToTypeSpec): New overload with an extra gen_param_count
	param.
	(PEFile.AddMethodSpec): Change return type from void to Method.


svn path=/trunk/mcs/; revision=54160
2005-12-09 13:02:33 +00:00
Ankit Jain 3c22594b57 * PEAPI.cs: Clean up indentation. Split into ...
Metadata.cs, Code.cs, PEAPI.cs: ... these.

svn path=/trunk/mcs/; revision=50145
2005-09-16 12:48:51 +00:00
Ankit Jain e92e32c00b * PEAPI.cs (FileImage.stackReserve): New. Set to default value of 0x100000 (1Mb).
(FileImage.WritePEHeader): Write stackReserve instead of the default value.
  (PEFile.SetStackReserve): Set stack reserve for fileImage.

svn path=/trunk/mcs/; revision=49698
2005-09-08 13:19:11 +00:00
Ankit Jain 2ba6f2c22e * PEAPI.cs (MetaData.WriteTildeStream): Change minor version back to 0.
svn path=/trunk/mcs/; revision=49521
2005-09-06 07:04:01 +00:00
Ankit Jain 2aa515d248 * PEAPI.cs (MetaData.WriteTildeStream): Change minor version to 1.
svn path=/trunk/mcs/; revision=49134
2005-08-30 15:05:12 +00:00
Ankit Jain 3ad4418ae9 * PEAPI.cs (CustomMarshaller.ctor): New.
(CustomMarshaller.ToBlob): Emit marshallerName and cookie strings with
  their lengths.

svn path=/trunk/mcs/; revision=49066
2005-08-29 13:25:19 +00:00
Ankit Jain 45cceead2a * PEAPI.cs (PEFile.ctor): Restore old constructor overload to avoid
changing public API.

svn path=/trunk/mcs/; revision=48890
2005-08-26 13:24:00 +00:00
Ankit Jain 275b170bce * PEAPI.cs (IResolutionScope): New. Empty interface.
(ClassRef): Implement IResolutionScope.
  (ClassRef.parent): Change type from ResolutionScope to IResolutionScope.
  (ClassRef.AddClass): New. Add nested class.
  (ClassRef.AddValueClass): New. Add nested value class.

svn path=/trunk/mcs/; revision=48888
2005-08-26 13:04:37 +00:00
Ankit Jain 9be4cdafa5 * PEAPI.cs (MetaData.version): Change from 1.0.3705 to 1.1.4322.
svn path=/trunk/mcs/; revision=48741
2005-08-23 15:50:39 +00:00
Ankit Jain 750eeca3c2 * PEAPI.cs (MSCorLib.systemClasses): Change type from ClassRef[] to
Class[].
  (MSCorLib.ctor): Add assembly ref to mscorlib for non-mscorlib assemblies
  only.
  (MSCorLib.AddClass): Use Class instead of ClassRef.
  (MSCorLib.GetSpecialClass): Change return type to Class from ClassRef.
  Don't instantiate object of SystemClass if this assembly is mscorlib.
  (MSCorLib.SetSpecialSystemClass): New. Set a System.* class for primitive
  types, used for compiling mscorlib.
  (MSCorLib.GetValueClass): Change to handle new type of systemClasses.
  (MSCorLib.ValueType),
  (MSCorLib.EnumType): Don't instantiate ClassRef if this assembly is mscorlib.
  (ClassDef.ctor): Don't superType to System.Object for System.Object and <Module>. 
  (ClassDef.MakeValueClass): Set typeIndex to ValueType's typeIndex.
  (ClassDef.IsValueType),
  (ClassDef.IsEnum): Use "==" instead of .CompareTo for string comparison.
  (ClassDef.AddNestedClass): Set typeIndexChecked = true for the nested class.
  (PEFile.isMSCorlib): New. bool field.
  (PEFile.ctor): Move all ctor logic into one overload and call that from others.
  (PEFile.ctor): Add outputDir parameter.
  (PEFile.SetName): Set name of the assembly and set isMSCorlib accordingly.
  (PEFile.IsMSCorlib): New. bool Property.
  (PEFile.AddClass): Call overload.
  (PEFile.AddClass): Set superType and SetSpecialSystemClass if compiling mscorlib.
  (PEFile.AddValueClass): Call MakeValueClass only if the class is not System.ValueType
  or System.Enum itself, else set the supertype correctly.

svn path=/trunk/mcs/; revision=48736
2005-08-23 15:15:48 +00:00
Ankit Jain 4aee6a75b2 * PEAPI.cs (FieldAttr): Move HasFieldMarshal from FieldDef to this.
(ParamAttr): Move HasDefault and HasFieldMarshal from Param to this.
  (ManifestResource.ctor): Use 'mres' param to clone.
  (MethodDef.ret_param): New.
  (MethodDef.AddRetTypeMarshallInfo): New.
  (MethodDef.TypeSig): Set seqNo for ret_param to zero.
  (MethodDef.BuildTables): Add ret_param to Param table, and BuildTables
  for it.
  (FixedSysString): New. Class to represent Fixed SysString native type.
  (NativeArray): Rename len to numElem. Init numElem, parNum and elemMult
  to -1.
  (NativeArray.ctor): Uncomment ctor with one param (elemType).
  (NativeArray.ctor): Move ctor logic to the one with all params.
  (NativeArray.ToBlob): Emit values in correct order.
  (SafeArray.hasElemType): New. bool var to indicate presence of ElemType.
  (SafeArray.ctor): New. Parameterless constructor.
  (SafeArray.ToBlob): Emit correctly.
  (FixedArray.ctor): Remove elemType param.
  (FixedArray.ToBlob): Don't emit elemType.

svn path=/trunk/mcs/; revision=48409
2005-08-16 04:53:09 +00:00
Ankit Jain 52c3e7de65 * PEAPI.cs (CodeBlock): Set maxCodeSize to 255 instead of 256 for checking
Fat format.
  (CILInstructions.CheckCode): Use 255 instead of 256 for checking Fat format.

svn path=/trunk/mcs/; revision=48099
2005-08-08 04:05:17 +00:00
Ankit Jain 428cd810ad In ilasm/codegen:
2005-08-08  Ankit Jain  <[email protected]>

	* CodeGen.cs (CodeGen.entry_point): New bool field.
	  (CodeGen.HasEntryPoint): New. Property to mark that the assembly
	  has an entrypoint.
	  (CodeGen.Write): Throw Exception if an EXE has been requested but the
	  source file has no entrypoint defined.

In ilasm/parser:
2005-08-08  Ankit Jain  <[email protected]>

	* ILParser.jay (method_decl | D_ENTRYPOINT): Set codegen.HasEntryPoint
	  to true.

In class/PEAPI:
2005-08-08  Ankit Jain  <[email protected]>

	* PEAPI.cs (FileImage.WriteCLIHeader): Move the check for no entrypoint
	  in case of an EXE to ilasm/codegen/CodeGen.cs to avoid creating unnecessary
	  .exe.


svn path=/trunk/mcs/; revision=48097
2005-08-08 03:40:16 +00:00
Ankit Jain 4e75920f55 * PEAPI.cs (FileImage.WriteCLIHeader): Throw Exception if an EXE has been
requested but the source file has no entrypoint defined.

svn path=/trunk/mcs/; revision=48032
2005-08-05 06:29:38 +00:00
Ankit Jain 4066d0b80f * PEAPI.cs (TypeAttr): Add HasSecurity.
(MethAttr): Likewise.
  (SecurityAction): New enum.
  (DeclSecurity.ctor): Add 'byte []' as the third parameter.
  (DeclSecurity.BuildTables): Write the byte array to the blob.
  (MetaData.AddDeclSecurity): Add DeclSecurity to declsec_list.
  (MetaData.BuildMetaData): Call BuildTables for declsec_list members.
  (PEFile.AddDeclSecurity): New. Add DeclSecurity to metaData.

svn path=/trunk/mcs/; revision=48028
2005-08-05 04:35:17 +00:00
Ankit Jain af4e01ebca * PEAPI.cs (InterfaceImpl.SortKey): New.
(MetaData.BuildMetaData): Sort InterfaceImpl table.
(MethodSemantics.SortKey): Compute key correctly.

svn path=/trunk/mcs/; revision=43822
2005-04-30 09:31:35 +00:00
Raja R Harinath 74b4a7ec6f svn:eol-style native
svn path=/trunk/mcs/; revision=43702
2005-04-28 03:25:52 +00:00
Ankit Jain f34ab3ffa7 In class/PEAPI:
2005-04-18  Ankit Jain  <[email protected]>

	* PEAPI.cs (ManifestResource.InitResource): New. Used by constructors
	to initialize the resource. 
	(ManifestResource.ctor): New. Constructor to accept resource as a 
	byte array.
	(ManifestResource.ctor): New. Constructor to accept an object of self. 
	(ManifestResource.BuildTables): Update.
	(MetaData.AddResource): New. Add the resource to the list, adjust 
	resourcesSize.
	(MetaData.WriteResource): New. Write resources to the FileImage.
	(PEFile.AddExternalManagedResource): New. Add a new resource.
	(PEFile.GetResource): New. Get resource by name.
	(PEFile.GetResources): New. Get array of resources.

In ilasm/codegen:
2005-04-18  Ankit Jain  <[email protected]>

	* CodeGen.cs (CodeGen.AddManifestResource): Add a
	ManifestResource to manifestResources ArrayList.
	(CodeGen.Write): Add all resources to the pefile.

In ilasm/parser:
2005-04-18  Ankit Jain  <[email protected]>

	* ILParser.jay (manifestres_head): Read resource file and 
	add ManifestResource with CodeGen.
	(manres_attr): Set visibility flag of the resource.
	

svn path=/trunk/mcs/; revision=43182
2005-04-18 04:17:27 +00:00
Ankit Jain 509a0e4811 In class/PEAPI:
2005-04-12  Ankit Jain  <[email protected]>

	* PEAPI.cs (CustomAttribute.ctor): Dont throw 
	NotYetImplementedException.
	(MethodSemantics.SortKey): Should be sorted by 
	'Association' column.
	
In ilasm/codegen:
2005-04-12  Ankit Jain  <[email protected]>

	* CustomAttr.cs (ICustomAttrTarget): New interface.
	* TypeDef.cs: Implement ICustomAttrTarget.
	* FieldDef.cs, PropertyDef.cs, ParamDef.cs, EventDef.cs
	(AddCustomAttribute): Implement ICustomAttrTarget
	(.Resolve): Add custom attributes.
	* CodeGen.cs (CurrentCustomAttrTarget): New. Property for 
	current CustomAttr target.
	(BeginTypeDef, BeginMethodDef, BeginAssemblyRef): Set
	current_customattrtarget accordingly.
	* ExternTable.cs (ExternRef): Implement ICustomAttrTarget.
	(ExternModule.Resolve): Add custom attributes to ModuleRef.
	(ExternAssembly.Resolve): Add custom attributes to AssemblyRef.
	* MethodDef.cs: Implement ICustomAttrTarget and add custom
	attributes.
	(GetParam): New. Get ParamDef by index.

In ilasm/parser:
2005-04-12  Ankit Jain  <[email protected]>

	* ILParser.jay (class_decl, method_decl, prop_decl, 
	assemblyref_decl | customattr_decl): Use
	codegen.CurrentCustomAttrTarget for adding custom
	attributes.
	(field_decl, method_decl, event_head, prop_head):
	Set codegen.CurrentCustomAttrTarget 	


svn path=/trunk/mcs/; revision=42836
2005-04-12 14:56:28 +00:00
Raja R Harinath 9313ba658b In ilasm/codegen:
2005-04-08  Ankit Jain  <[email protected]>

	* MethodDef.cs (named_param_table, CreateNamedParamTable): Remove.
	(GetNamedParamPos): Implement using a linear scan.

	* TypeDef.cs (TypeDef): Initialize 'is_enum_class'.
	(Define): Set 'is_value_class' or 'is_enum_class' depending on
	whether the parent is System.ValueType or System.Enum.  Update to
	changes in PEAPI.cs.

In ilasm/parser:
2005-04-08  Ankit Jain  <[email protected]>

	* ILParser.jay (type): When parsing K_VALUETYPE, mark the typeref
	as a value type.
	(field_init): The float32 and float64 constructor argument is
	the hex representation, not the integer equivalent value.

In class/PEAPI:
2005-04-08  Ankit Jain  <[email protected]>

	* PEAPI.cs (MSCorLib.GetSpecialClass): Don't encode
	System.ValueType and System.Enum as value types.
	(ValueClass): New enum.
	(Class.MakeValueClass): Add a 'ValueClass' parameter.
	(ClassDef.MakeValueClass): Set supertype to ValueType or Enum
	according to ValueClass parameter.
	(IsValueType,IsEnum): New.  Test if type is System.ValueType or
	System.Enum.
	(ClassDef.AddNestedClass): Don't encode	System.ValueType and
	System.Enum as value types.

svn path=/trunk/mcs/; revision=42684
2005-04-08 10:43:02 +00:00
Jackson Harper dcd9bb8fd3 class/PEAPI.cs: Metadata tables that must be sorted are sorted
now.
	Fixes the code for ParamAttr.Opt. Fix bug #73517.

        ilasm/codegen/MethodDef.cs: Added method AddParamDefaultValue
        for adding DefaultValue to a method parameter.
        ilasm/codegen/ParamDef.cs: Added method AddDefaultValue and 
handling of
        default value.

        ilasm/parser/ILParser.jay(method_decl): Add default value for
        a method param.

        Patches by Ankit Jain


svn path=/trunk/mcs/; revision=42483
2005-04-01 22:29:08 +00:00
Sebastien Pouliot 4145d2bfe2 2004-12-08 Sebastien Pouliot <[email protected]>
* PEAPI.cs: Added support for allocating and storing strongname 
	signatures when a .publickey directive is present in source. Fix bug
	#69721.


svn path=/trunk/mcs/; revision=37383
2004-12-08 12:48:08 +00:00
Jackson Harper e9583b1b0b * PEAPI.cs: Allow underlying types of ByteArrConsts to be set when
they are used as field init data.


svn path=/trunk/mcs/; revision=36973
2004-12-02 21:31:22 +00:00
Jackson Harper 427b383a21 * PEAPI.cs: Allow DataConstants underlying type to be set.
svn path=/trunk/mcs/; revision=36971
2004-12-02 20:58:02 +00:00
Martin Baulig 78b9c7623e 2004-07-29 Martin Baulig <[email protected]>
* PEAPI.cs (Module.Guid): New public property.

svn path=/trunk/mcs/; revision=31614
2004-07-29 16:13:10 +00:00
Martin Baulig e5d3fefab7 2004-07-27 Martin Baulig <[email protected]>
* PEAPI.cs (CILInstructions.Offset): New public property.

svn path=/trunk/mcs/; revision=31486
2004-07-26 22:58:24 +00:00
Jackson Harper fcef4ebc68 * PEAPI.cs: Make the type index modifiable so ClassRefInsts will
be emitted properly. This is in desperate need of some API
	love.

svn path=/trunk/mcs/; revision=31422
2004-07-23 19:14:30 +00:00
Jackson Harper f4bdfe7e7c * PEAPI.cs: Do all the index size checks. I always wondered why
the code was like that and finally realized today that it was like
	that because it was wrong. Wait until the opportune momement to
	calculate the index sizes (after everything has been added to the
	streams, and before writing anything).

svn path=/trunk/mcs/; revision=31348
2004-07-21 19:26:52 +00:00
Jackson Harper 6ab44a36cb * PEAPI.cs: Create ClassRefInsts with types not just
ClassRefs. This way modified types can be used. I am having alot
	of trouble remembering why I actually even need this class
	though.

svn path=/trunk/mcs/; revision=31329
2004-07-21 13:59:23 +00:00
Jackson Harper 642e198e29 Add MDTable.Field to the list of tables that can
increase the CustomAttributeType shift. TODO: What else should be
	here?

svn path=/trunk/mcs/; revision=31244
2004-07-17 00:12:01 +00:00
Jackson Harper e5b15494b2 * PEAPI.cs: make sure small index sizes get set properly. Use a
continue to reduce nesting a little and make code almost mildly
	readable.

svn path=/trunk/mcs/; revision=31242
2004-07-17 00:03:41 +00:00
Jackson Harper 2c73c8d166 * PEAPI.cs: Use a byte array hash code provider and comprarer, so
checking the byte hashtable for duplicate entries actually
	works. Old method was valid but created larger then needed
	binaries.

svn path=/trunk/mcs/; revision=31088
2004-07-13 15:14:17 +00:00
Jackson Harper f455475981 * PEAPI.cs: Don't build custom attributes twice.
svn path=/trunk/mcs/; revision=30963
2004-07-09 19:06:45 +00:00
Jackson Harper b51b3e4c5d * PEAPI.cs: Add custom attributes through the pefile so that we
can ensure they are emitted no matter what table they are
	in. Previously not all custom attributes were getting emitted.

svn path=/trunk/mcs/; revision=30882
2004-07-08 16:38:23 +00:00
Jackson Harper 54c716697c * PEAPI.cs: Add a method to set the fields list. This is needed so
that sequentially laid out fields are laid out in the right
	order. When building custom attribute tables actually emit the
	custom attribute data. When writing the .sdata section make sure
	to pad to its size. The constants itself will not make up the
	entire section because it is aligned on 512 byte blocks.

svn path=/trunk/mcs/; revision=30458
2004-06-27 03:11:40 +00:00
Jackson Harper 94c0773c00 * PEAPI.cs: Make sure the sentinel is placed properly for vararg
method pointers.

svn path=/trunk/mcs/; revision=29960
2004-06-19 23:12:20 +00:00
Jackson Harper ddecf09809 Give a little love
svn path=/trunk/mcs/; revision=29959
2004-06-19 22:30:13 +00:00
Jackson Harper b94c1f6680 * PEAPI.cs: Allow MethPtrTypes to be created from a signature
instead of from a method reference because it really doesn't make
	sense to do it that way ;-).

svn path=/trunk/mcs/; revision=29958
2004-06-19 21:14:45 +00:00
Jackson Harper 4cce9d7fd2 flush
svn path=/trunk/mcs/; revision=29563
2004-06-15 02:57:07 +00:00