2009-05-27 Rodrigo Kumpera * TypeDef.cs: Add field method_list to preserve definition order of methods when emiting the PE file. 2009-04-20 Ankit Jain Fix bug #494221 * MethodDef.cs (BeginLocalsScope): New. (EndLocalsScope): New. (AddLocals): (GetNamedLocal): Support scoping for .locals 2009-04-15 Ankit Jain * MethodDef.cs (GetNamedLocalSlot): Return -1 if local var not found. 2009-03-31 Rodrigo Kumpera * MethodDef.cs (WriteCode): Emit labels which use offsets as absolute PEAPI CilLabels. 2008-07-02 Ankit Jain Fix bug #405383 * MethodPointerTypeRef (Clone): Add missing null ref check. Patch from Andrea Carlo Ornstein 2008-06-07 Martin Baulig * DebuggingInfo.cs: Reflect latest symbol writer changes. 2008-06-02 Ankit Jain Fix bug #367114. * CatchBlock.cs: Allow exception to be of any type (BaseTypeRef) and not just a class (BaseClassRef). 2008-06-01 Ankit Jain Fix bug #364580. * MethodDef.cs (CreateSignature): Add new @include_optional and @call_conv param. Make private. (CreateVarargSignature): Likewise. (CreateSignature): Add new static method for vararg and other methods. (GetVarargSig): Add new @full_signature param to uniquely identify vararg methods. * CodeGen.cs (ResolveVarargMethod): This now takes two signatures - one with only the required params and the other with the optional ones, to correctly resolve global vararg methods. * BaseTypeRef.cs: * GenericTypeInst.cs: * GlobalMethodRef.cs: * PrimitiveTypeRef.cs: * TypeDef.cs: Track api changes. 2008-04-10 Erven Rohou * DebuggingInfo.cs: use new DefineMethod API. Remove useless variable. * MethodDef.cs: remove useless variable. 2008-04-07 Rodrigo Kumpera * MethodDef.cs: Mono.CompilerServices API has changed in an incompatible way since Erven's patch. Fixed it to follow the new one. 2008-04-07 Erven Rohou * DebugInfo.cs, MethodDef.cs: Add support for emitting variable names in mdb file. 2008-02-07 Gert Driesen * CodeGen.cs: Use original filename as base name for debug file. Symbol writer will already add .mdb to it. Fixes bug #359516. 2008-01-03 Rodrigo Kumpera * EmiteByteInstr.cs: Fixed typo in class name. 2007-12-31 Rodrigo Kumpera * EmiteByteInstr.cs: added. Implements support for the .emitbyte directive. 2007-12-31 Rodrigo Kumpera * SwitchInstr.cs (Emit): Switch from using strings to LabelInfo. 2007-10-09 Rodrigo Kumpera * MethodPointerTypeRef.cs (.ctor): generate full name of the method pointer. This is required to alow overloading with method pointers. 2007-07-18 Jb Evain * InstrTable.cs: add brzero alias. 2007-01-10 Ankit Jain * BaseClassRef.cs (Clone): Move to .. * BaseTypeRef.cs (Clone): .. here. * Sentinel.cs: Implement abstract Clone method. * MethodPointerTypeRef.cs: Likewise. * PrimitiveTypeRef.cs: Likewise. * ModifiableType (MakeCustomModified): Add to SigMod. * GenericTypeInst.cs: * GenericParamRef.cs: * TypeRef.cs: * ExternTypeRef.cs: Update. Tue Dec 12 19:23:34 CET 2006 Paolo Molaro * PropertyDef.cs: support more than one .other method in properties. Tue Dec 12 19:19:04 CET 2006 Paolo Molaro * EventDef.cs: support more than one .other method in events. 2006-11-09 Ankit Jain * CodeGen.cs (CodeGen.BeginAssemblyRef): Add param for attributes. (SetAssemblyName): Rename to .. (SetThisAssembly): .. this. Add param for attributes. * ExternTable (ExternAssembly.ctor): Likewise. (ExternAssembly.Resolve): Add attributes. (ExternTable.AddAssembly): Add param for attributes. (ExternTable): Update to changes. * Assembly.cs (Assembly.SetAssemblyAttr): New. (Assembly.Resolve): Add the flags. 2006-07-20 Ankit Jain * TypeDef.cs (.ctor): If the type is an interface, then make it abstract. (TypeDef.AddMethodDef): Set an interface method abstract and virtual if it lacks either of the attributes. * MethodDef.cs (MethodDef.FullName): New. (MethodDef.WriteCode): Make global methods, non-abstract and static. Interface cannot have a non-static method with a body. Update error messages to use new FullName property. 2006-06-07 Ankit Jain * TypeDef.cs (TypeDef.IsAbstract): New. * MethodDef.cs (MethodDef.WriteCode): Parent type must also be abstract for an abstract method. Abstract methods cannot have a body. Report errors for body with different implementation attributes like native/runtime/unmanaged etc. If the method has no body, then emit a 'ret'. 2006-06-07 Ankit Jain * TypeDef.cs (TypeDef.AddFieldDef): (TypeDef.Define): Use Report.Warning instead of Console.Error.WriteLine (TypeDef.AddMethodDef): Likewise. Also, use methoddef.Location . * ExternTable.cs (ExternTable.GetTypeRef): Likewise. * MethodDef.cs (MethodDef.StartLocation): New. 2006-06-01 Ankit Jain * MethodDef.cs (GetNamedParamPos): Return -1 if param_list is null. 2006-06-01 Ankit Jain * 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. 2006-05-31 Ankit Jain * TypeDef.cs (TypeDef.IsValueType): New. (TypeDef.IsEnumType): New. (TypeDef.Define): Don't seal System.ValueType or System.Enum . 2006-05-26 Ankit Jain * Assembly.cs: New. Represents a '.assembly {}' (assembly manifest). * CodeGen.cs: Update to use the Assembly class. 2006-05-26 Ankit Jain * 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. 2006-05-23 Ankit Jain * DeclSecurity.cs (IDeclSecurityTarget): Remove AddPermission & AddPermissionSet methods. Add 'DeclSecurity' property. * TypeDef.cs: Update implementation of IDeclSecurityTarget interface. * MethodDef.cs: Likewise. * ExternTable.cs: Likewise. * CodeGen.cs (CodeGen.AddPermission): Use IDeclSecurityTarget.DeclSecurity . 2006-05-11 Ankit Jain * CodeGen.cs (CodeGen.AddDataDef): Use Report.Error for consistent error reporting. * MethodDef.cs (MethodDef.AddLabel): Likewise. 2006-05-11 Ankit Jain * MethodDef.cs (MethodDef.AddLabel): Fix exception message. 2006-05-09 Ankit Jain * MethodDef.cs (MethodDef.AddLabel): Throw exception for duplicate labels. 2006-05-09 Ankit Jain * CodeGen.cs (CodeGen.data_list): Change to .. (CodeGen.data_table): .. a hashtable. (CodeGen.AddDataDef): Update to throw exception for duplicate .data labels. (CodeGen.GetDataConst): Update to use data_table. 2006-04-24 Ankit Jain * CodeGen.cs (CodeGen.ctor): Remove 'is_assembly' param. (CodeGen.Write): Emit assembly manifest only if the source had it. 2006-02-22 Ankit Jain * ExternTable.cs (ExternTable.GetTypeRef): Emit a warning if mscorlib is referenced without a corresponding '.assembly extern' directive. * TypeDef.cs (TypeDef.Define): Valuetype class should be sealed. Emit warning if its not, and make it so. 2006-02-20 Ankit Jain * *.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. 2006-02-19 Ankit Jain * ExternTable.cs (ExternTable.GetModuleTypeRef): 'module_table' can be null. 2006-02-19 Ankit Jain * CodeGen.cs (CodeGen.Write): Use only filename as the name of the module. * TypeDef.cs (TypeDef.ResolveAsMethodRef): New. (TypeDef.ResolveMethod): Change signature to take ret_type, params etc instead of a signature string. Also, if the method does not exist, then use ResolveAsMethodRef to return a MethodRef for it. (TypeDef.ResolveVarargMethod): Likewise. (TypeDef.ResolveField): Likewise. * MethodRef.cs (MethodRef.Resolve): Update use of TypeDef.Resolve* methods. * FieldRef.cs (FieldRef.Resolve): Update use of TypeDef.ResolveField. * PropertyDef.cs (PropertyDef.AsMethodDef): Throws an exception is the method is not a MethodDef. (PropertyDef.Define): Use AsMethodDef to ensure that get/set/other are MethodDefs. * EventDef.cs (EventDef.AsMethodDef): Same as PropertyDef. (EventDef.Define): Likewise. 2006-02-19 Ankit Jain * CodeGen.cs (CodeGen.ThisModule): New. (CodeGen.Write): Set module name if not set by '.module' directive. * Module.cs: Inherit from ExternRef. 2006-02-10 Ankit Jain * CodeGen.cs (CodeGen.ResolveMethod): Throw exception if global method not found. (CodeGen.ResolveField): Likewise for global field. 2006-02-08 Ankit Jain * PeapiTypeRef.cs (PeapiTypeRef.MakeBoundArray): Simplify and fix behavior. 2006-01-31 Ankit Jain * TypeDef.cs (TypeDef.AddMethodDef): Throw exception with proper message if adding a duplicate method. 2006-01-31 Ankit Jain * InstrTable.cs (inst_table): Add 'readonly.' . 2006-01-31 Ankit Jain * ExternTable.cs (ExternTable.GetTypeRef): If type is from an undeclared assembly, then add reference to the assembly. 2006-01-28 Ankit Jain * MethodDef.cs: * TypeManager.cs: * MethodPointerTypeRef.cs: * ExternMethodRef.cs: Remove unused variables to fix warnings. 2006-01-28 Ankit Jain * TypeDef.cs (GenericInfo): * MethodDef.cs (GenericInfo): Remove (unused). 2006-01-23 Ankit Jain * TypeDef.cs (TypeDef.AddFieldDef): Throw exception if duplicate field being added. 2006-01-19 Ankit Jain * Module.cs (Module): New. Class for representing this module. * CodeGen.cs (CodeGen): Update to use the new Module class. (CodeGen.Write): Resolve this_module. 2006-01-19 Ankit Jain * GenericParameters.cs (GenericParameter): Implement ICustomAttrTarget. (GenericParameter.Resolve): New overload, reduce code duplication. (GenericParameters.GetGenericParam): New. Returns a GenericParameter. (GenericParameters.GetGenericParamNum): Update to use new GetGenericParam. * TypeDef.cs (TypeDef.GetGenericParam): New. Two overloads for id and index. * MethodDef.cs (MethodDef.GetGenericParam): Likewise. 2006-01-19 Ankit Jain * MethodRef.cs (MethodRef.Resolve): Resolve owner. 2006-01-16 Ankit Jain * TypeDef.cs (TypeDef.IComparable): Implement IComparable interface. * TypeManager.cs (TypeManager.DefineAll): Sort type_table before Define()'ing. 2006-01-16 Ankit Jain * TypeRef.cs (TypeRef.CreateMethodRef): Return a TypeSpecMethodRef if this is a modified (eg. []) type. 2006-01-16 Ankit Jain * BaseTypeRef.cs (BaseTypeRef.Resolve): Make this abstract. (BaseTypeRef.CreateMethodRef): (BaseTypeRef.CreateFieldRef): Make protected and abstract. * BaseClassRef.cs (BaseClassRef.Clone): Make this abstract. Update all derived classes. * PrimitiveTypeRef.cs (PrimitiveTypeRef.CreateMethodRef): * GenericTypeInst.cs (GenericTypeInst.CreateMethodRef): Implement, but throw exception as this method is not used. 2006-01-14 Ankit Jain * GenericParamRef.cs (GenericParamRef.Resolve): Apply modifications to the cached type. 2006-01-14 Ankit Jain * GenericParamRef.cs (GenericParamRef.Resolve): Set PeapiType of the instance to the cached one. 2006-01-13 Ankit Jain * GenericParamRef.cs (GenericParamRef.Resolve): Ensure no duplicate GenParams get added to the TypeSpec table. * GenericMethodSig.cs (GenericMethodSig.GetInstance): Cache sigs in a static hashtable. * BaseMethodRef.cs (BaseMethodRef.GetGenericMethodRef): Cache GenericMethodRefs. 2006-01-13 Ankit Jain Create BaseMethodRef from IMethodRef. Replace usage of IMethodRef with BaseMethodRef in *all* files. Remove implementations of IMethodRef's methods from derived classes. * BaseMethodRef.cs: New. 2006-01-13 Ankit Jain Move caching of method-refs and field-refs to BaseTypeRef, and use CreateMethodRef & CreateFieldRef for creating the actual object. Override these in derived classes to return the right objects. * BaseTypeRef.cs (BaseTypeRef.CreateMethodRef): New. (BaseTypeRef.CreateFieldRef): New. (BaseTypeRef.GetMethodRef): Implement caching. (BaseTypeRef.GetFieldRef): Likewise. GenericTypeInst and PrimitiveTypeRef are not cached, so static hashtables are used here for caching their MethodRefs n FieldRefs. * GenericTypeInst.cs (GenericTypeInst.GetMethodRef): Override and use static hashtable to do caching. (GenericTypeInst.GetFieldRef): Likewise. * PrimitiveTypeRef.cs (PrimitiveTypeRef.GetMethodRef): Likewise. (PrimitiveTypeRef.GetFieldRef): Likewise. * CodeGen.cs (CodeGen.GetGlobalMethodRef): New. Cache global method refs. (CodeGen.GetGlobalFieldRef): New. Cache global field refs. 2006-01-13 Ankit Jain Create BaseClassRef, BaseGenericTypeRef from IClassRef & IGenTypeRef. Replace usage of interfaces ITypeRef, IClassRef & IGenTypeRef with their corresponding Base* types. * BaseTypeRef.cs: New. Combine ITypeRef and ModifiableType into this. * BaseClassRef.cs: New. * BaseGenericTypeRef.cs: New. * TypeSpecMethodRef.cs (TypeSpecMethodRef.ctor): Slight change in order of params. 2006-01-12 Ankit Jain * MethodDef.cs (MethodDef.CreateSignature): Use "`n" only for generic methods. 2006-01-11 Ankit Jain * InstrTable.cs (inst_table): Uncomment stelem and ldelem . 2006-01-11 Ankit Jain Support new syntax of specifying namespace, ie., as part of the type name. (gen-nested2.il) * TypeDef.cs (TypeDef.ctor): Add outer as a param. Don't split name on '.' for inner classes. * CodeGen.cs (CodeGen.BeginTypeDef): Update to use only 'name' for inner classes and FullName for outermost class. 2006-01-10 Ankit Jain * TypeDef.cs (TypeDef.GetGenericParamNum): Return -1 if type has no generic parameters. * MethodDef.cs (MethodDef.GetGenericParamNum): Likewise. 2006-01-10 Ankit Jain * MethodDef.cs (MethodDef.WriteCode): Resolve generic params for abstract methods also. 2006-01-10 Ankit Jain * TypeDef.cs (TypeDef.TypeParameters): New. (TypeDef.ResolveGenParams): New. Resolve any gen param refs in constraints, base class ref or implemented interfaces. * MethodDef.cs (MethodDef.ResolveGenParams): Update to use new Resolve overloads and ResolveConstraints for GenericParameters. * GenericTypeInst.cs (GenericTypeInst.Resolve): Resolve generic args. * GenericParamRef.cs (GenericParamRef.Resolve): Implement. * GenericParameters.cs (GenericParameter.ResolveConstraints): New. (GenericParameters.ResolveConstraints): New. * GenericArguments.cs (GenericArguments.Resolve): New. * TypeRef.cs (TypeRef.GetGenericTypeInst): Don't cache. * ExternTypeRef.cs (ExternTypeRef.GetGenericTypeInst): Likewise. 2006-01-09 Ankit Jain * GenericArguments.cs (GenericArguments.is_resolved): New. (GenericArguments.p_type_list): New. Resolve only once and return this. 2006-01-09 Ankit Jain * TypeDef.cs (TypeDef.Define): Set is_defined to true as soon as the Peapi type gets created. 2006-01-09 Ankit Jain * 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. 2006-01-08 Ankit Jain * InstrTable.cs (inst_table): Add stelem.any, ldelem.any and constrained. instructions. 2006-01-07 Ankit Jain * GenericParameters.cs (GenericParameter): New. (GenericParameters): Collection of Generic parameters. * TypeDef.cs: * CodeGen.cs: * MethodDef.cs: Update to use the new GenericParameters class. 2006-01-06 Ankit Jain GenericTypeInst.Resolve should do the expected thing ie., resolve and add the Generic Inst to the typespec table. Use ResolveOnly to Resolve w/o adding to the table. * GenericTypeInst.cs (GenericTypeInst.Resolve): Rename to .. (GenericTypeInst.ResolveOnly): .. this. (GenericTypeInst.ResolveAsClass): Rename to Resolve. * TypeDef.cs (TypeDef.Define): Revert the ResolveAsClass calls added here. * Local.cs (Local.GetPeapiLocal): Use new GenericTypeInst.ResolveOnly if type is GenericTypeInst. 2006-01-06 Ankit Jain * 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. 2005-12-24 Jb Evain * FeatureAttr.cs: tag as Flags, add an Instance value. * PropertyDef.cs (PropertyDef.Resolve): Tag the property as instance or class. 2005-12-22 Ankit Jain * MethodDef.cs (MethodDef.ctor): Add type_def param. Use this for all uses of the owner type_def. ResolveGenParams () before creating signature. (MethodDef.ResolveGenParams): (MethodDef.ResolveGenParam): Remove type_def param, instead use type_def field. (MethodDef.Define): Remove overload with typedef param. (MethodDef.CreateSignature): Put "`0" right after the name instead of at the end. * TypeDef.cs (TypeDef.DefineContents): Update usage of MethodDef.Define . 2005-12-21 Ankit Jain * GenericArguments.cs (GenericArguments): New. * ExternTypeRefInst.cs (ExternTypeRefInst): * GenericTypeInst.cs (GenericTypeInst): * GenericMethodSig.cs (GenericMethodSig): Update to use new GenericArguments class. 2005-12-16 Ankit Jain Use tuple of (field name, type_name) for fielddef hashtable in TypeDef.cs and CodeGen.cs * FieldDef.cs (FieldDef.Type): New. * TypeDef.cs (TypeDef.ResolveField): Add 'type_name' param. * CodeGen.cs (CodeGen.ResolveField): Add 'type_name' param. * FieldRef.cs (FieldRef.Resolve): Update usage of .ResolveField . * GlobalFieldRef (GlobalFieldRef.Resolve): Likewise. * ExternTable.cs (IScope.FullName): New. Returns full name including and enclosing class or assembly/module name. (ExternRef.FullName): (ExternModule.FullName): (ExternAssembly.FullName): Implement new IScope.FullName . * ExternTypeRef.cs (ExternTypeRef.Clone): Clone SigMod also. (ExternTypeRef.FullName): Update to return full name including enclosing type or assembly or module name. (ExternTypeRef.Name): Update to return only full_name with modifiers (array/pointers etc). (ExternTypeRef.GetReflectedType): Use Name instead of FullName as only type name is required here. * GenericTypeRef.cs (GenericTypeRef.FullName): Return proper fullname of the form (!0 or !!0). * GenericTypeInst.cs (GenericTypeInst.ctor): Change param 'full_name' to 'name'. 'full_name' is constructed here using the type parameter list. Update code to use name instead of full_name. 2005-12-15 Ankit Jain * CodeGen.cs (CodeGen.SetAssemblyName): Multiple .assembly declarations with different names are not allowed. 2005-12-14 Ankit Jain * PeapiTypeRef.cs (PeapiTypeRef.MakeBoundArray): Handle the case when only lower bound (no size info) is available. 2005-12-14 Ankit Jain * TypeDef.cs (TypeDef.ctor): name_space can be null. 2005-12-13 Ankit Jain * TypeDef.cs (TypeDef.ctor): Ensure that 'name' contains only the last part of the full (namespace + name) dotted name. 2005-12-12 Ankit Jain * TypeDef.cs (TypeDef.Define): Ensure nested visibility for a nested class. (TypeDef.NestedFullName): New. 2005-12-09 Ankit Jain * MethodDef.cs (MethodDef.GenParamCount): typar_list can be null. 2005-12-09 Ankit Jain * 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. 2005-12-05 Ankit Jain * TypeDef.cs (TypeDef.GenericInfo.num): New. (TypeDef.AddGenericParam): Set num for GenericInfo. * MethodDef.cs (MethodDef.GenericInfo.num): New. (MethodDef.AddGenericParam): Set num for GenericInfo. * GenericTypeRef.cs (GenericTypeRef.ctor): Update to use PEAPI.GenParam instead of PEAPI.MVar and PEAPI.GenericTypeSpec. 2005-11-28 Ankit Jain * ExternTypeRef.cs (extern_table): Remove unused field. (.ctor): Remove parameter for extern_table. Update usage accordingly. * ExternTable.cs (IScope): Remove unused 'table' parameter. (ExternRef): Change IScope interface implementation accordingly. Update call to ExternTypeRef.ctor for the previous change. 2005-09-15 Ankit Jain * DeclSecurity.cs (IDeclSecurityTarget.AddDeclSecurity): Remove. (IDeclSecurityTarget.AddPermission), (IDeclSecurityTarget.AddPermissionSet): New. (DeclSecurity.IDeclSecurityTarget): Implement new interface methods. (DeclSecurity.sec_action), (DeclSecurity.data): Remove. (DeclSecurity.permissionset_table): New. (DeclSecurity.ctor): Replace parameterized constructor with a default one. (DeclSecurity.AddTo): AddDeclSecurity for all Security Actions in the permissionset_table. * TypeDef.cs (TypeDef.declsecurity_list): Remove. (TypeDef.decl_sec): New. (TypeDef.IDeclSecurityTarget): Implement new interface methods. (TypeDef.DefineContents): Use new decl_sec instead of declsecurity_list. * CodeGen.cs (CodeGen.assembly_declsec): Change type from ArrayList to DeclSecurity. (CodeGen.EndAssemblyRef): Set current_customattrtarget and current_declsectarget to null. (CodeGen.IDeclSecurityTarget): Implement new interface methods. (CodeGen.Write): Add assembly_declsec to the assembly (using DeclSecurity.AddTo). * ExternTable.cs (ExternAssembly.declsec_list): Remove. (ExternAssembly.decl_sec): New. (ExternAssembly.Resolve): Use new decl_sec instead of declsec_list. (ExternAssembly.IDeclSecurityTarget): Implement new interface methods. * MethodDef.cs (MethodDef.declsecurity_list): Remove. (MethodDef.decl_sec): New. (MethodDef.IDeclSecurityTarget): Implement new interface methods. (MethodDef.WriteCode): Use new decl_sec instead of declsecurity_list. * ExternTypeRef.cs (ExternTypeRef.GetReflectedType): New. 2005-09-08 Ankit Jain * CodeGen.cs (CodeGen.stack_reserve): New. (CodeGen.SetStackReserve): New. (CodeGen.Write): SetStackReserve on the pefile. 2005-09-06 Ankit Jain * ExternTable.cs (ExternRef.is_resolved): New. (ExternModule.Resolve, ExternAssembly.Resolve, ExternTable.Resolve): Return if is_resolved. Set to true at the end. 2005-08-29 Ankit Jain * InstrTable.cs (inst_table): Comment out stelem and ldelem opcodes. 2005-08-26 Ankit Jain * ExternTable.cs (IScope): New. Interface for ResolutionScope. (ExternRef): Implement IScope. (ExternRef.GetTypeRef): Handle references to nested classes. (ExternRef.GetValueType): Remove. Logic combined with GetType. (ExternRef.GetType): Add param 'is_valuetype' and handle accordingly. * ExternTypeRef.cs (ExternTypeRef): Implement IScope. (ExternTypeRef.extern_ref), (ExternTypeRef.ctor), (ExternTypeRef.ExternRef): Change extern_ref type from ExternRef to IScope. (ExternTypeRef.nestedtypes_table), (ExternTypeRef.nestedclass_table): New. Hashtables for nested classes. (ExternTypeRef.Resolve): Resolve parent if it is ExternTypeRef type. (ExternTypeRef.GetTypeRef): New. (ExternTypeRef.GetExternTypeRef): New. Returns the resolve PEAPI type. (ExternTypeRef.GetType): New. 2005-08-23 Ankit Jain * ExternTable.cs (ExternTable.ctor): Remove. Move the initialization code to the new method AddCorlib. (ExternTable.AddCorlib): New. (ExternTable.Resolve): Assembly_table can be null so check before using it. (ExternTable.GetTypeRef): AddCorlib if mscorlib is being referenced but assembly_table is still null. * CodeGen.cs (CodeGen.SetAssemblyName): Call AddCorlib if name is not mscorlib. (CodeGen.Write): Pass null for new outputDir param for PEFile ctor. * (PrimitiveTypeRef.Name): New. Returns the full_name. 2005-08-18 Ankit Jain * IMethodRef.cs (IMethodRef.Owner): New. Returns owner of the method. * GlobalMethodRef.cs (GlobalMethodRef), MethodRef.cs (MethodRef), ExternMethodRef.cs (ExternMethodRef), GenericMethodRef.cs (GenericMethodRef), TypeSpecMethodRef.cs (TypeSpecMethodRef): Implement IMethodRef.Owner. * CustomAttr.cs (CustomAttr.IsSuppressUnmanaged): New. Checks if the it is a "System.Security.SuppressUnmanagedCodeSecurityAttribute" and is from "mscorlib" or the current assembly is mscorlib itself. * TypeDef.cs (TypeDef.DefineContents), MethodDef.cs (MethodDef.WriteCode): Set HasSecurity attribute if SuppressUnmanagedCodeSecurity custom attribute is present. * ExternTable.cs (ExternRef.Name): New. * ExternTypeRef.cs (ExternTypeRef.ExternRef): New. Returns the corresponding extern ref. 2005-08-18 Ankit Jain * MethodDef.cs (MethodDef.WriteCode): Process custom attributes and decl security lists even for abstract methods. 2005-08-16 Ankit Jain * CodeGen.cs (CodeGen.current_field_native_type): New. (CodeGen.AddFieldMarshalInfo): New. Add marshal info for the current field. (CodeGen.AddFieldDef): Add marshal info for the field. * FieldDef.cs (FieldDef.native_type): New. Native type for marshalling. (FieldDef.AddMarshalInfo): New. Set native_type. (FieldDef.Resolve): Set MarshalInfo for field_def. * MethodDef.cs (MethodDef.ret_native_type): New. Native type for return type. (MethodDef.AddRetTypeMarshalInfo): New. (MethodDef.EntryPoint): Throw exception is the method is not static. (MethodDef.Resolve): Call overload with class_def=null. (MethodDef.Resolve): Add global methods to code_gen.PEFile. Add marshal info for return type. * ParamDef.cs (ParamDef.native_type): New. Native type for marshalling. (ParamDef.AddMarshalInfo): New. (ParamDef.Define): Add marshal info to peapi_param. 2005-08-08 Ankit Jain * ExternTypeRef.cs (ExternTypeRef.Clone): Use full_name instead of FullName to avoid cloning modifiers (like []). 2005-08-08 Ankit Jain * 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. 2005-08-05 Ankit Jain * DeclSecurity.cs: New File. (DeclSecurity): New class. (IDeclSecurityTarget): New interface. * TypeDef.cs (TypeDef): Implement IDeclSecurityTarget. (TypeDef.DefineContents): Add DeclSecurity info. * CodeGen.cs (CurrentDeclSecurityTarget): New. Property for current DeclSecurity target. (BeginTypeDef, BeginMethodDef, BeginAssemblyRef): Set current DeclSecurity target accordingly. (AddAssemblyDeclSecurity): New. Add DeclSecurity info to assembly. * ExternTable.cs (ExternAssembly): Implement IDeclSecurityTarget. (Resolve): Add DeclSecurity info to AssemblyRef. * MethodDef.cs (MethodDef): Implement IDeclSecurityTarget. (WriteCode): Add DeclSecurity info to MethodDef. 2005-08-03 Ankit Jain * GlobalMethodRef.cs (GlobalMethodRef.Resolve): Use CreateVarargSignature to create method's signature for a vararg method. 2005-08-02 Ankit Jain Fix #61512. * TypeDef.cs (TypeDef.Define): Use default values for pack and size if only one of them is unspecified. 2005-05-10 Ankit Jain Fix #74768. * ExternTable.cs (ExternRef.GetTypeRef): Make ValueClass if requested. Hack alongwith Hari. 2005-05-06 Ankit Jain * MethodDef.cs (MethodDef.GetNamedParamPos): Param num starts from 1 for instance methods. * CodeGen.cs (CodeGen.BeginTypeDef): Set current_customattrtarget when reopening a class. 2005-04-27 Ankit Jain * ExternTypeRefInst.cs (ExternTypeRefInst.GetMethodRef): Use method_table to avoid creating duplicates. * PrimitiveTypeRef.cs (PrimitiveTypeRef.GetMethodRef): Use method_table to avoid creating duplicates * PeapiTypeRef.cs (Pair): New class. Tuple of PEAPI.Type and string. (PeapiTypeRef.type_table): New. (PeapiTypeRef.MakeArray, MakeBoundArray, MakeManagedPointer, MakeUnmanagedPointer, MakeCustomModified): Use type_table to avoid creating duplicates. 2005-04-22 Atsushi Enomoto * InstrTable.cs : ble.un.s and blt.un.s were incorrectly added to the table. 2005-04-22 Ankit Jain * TypeSpecMethodRef.cs (TypeSpecMethodRef.Resolve): Set is_resolved to true. 2005-04-18 Ankit Jain * CodeGen.cs (CodeGen.AddManifestResource): Add a ManifestResource to manifestResources ArrayList. (CodeGen.Write): Add all resources to the pefile. 2005-04-12 Ankit Jain * 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. 2005-04-08 Ankit Jain * 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. 2005-03-17 Ankit Jain * MethodDef.cs: Added method AddParamDefaultValue for adding DefaultValue to a method parameter. * ParamDef.cs: Added method AddDefaultValue and handling of default value. 2005-02-07 Jackson Harper * MethodDef.cs: Don't die on duplicate local symbols. Fixes bug 72149. Patch by Sohail Somani. 2004-12-14 Raja R Harinath * MethodDef.cs (CreateSignature): Add a space in generated signature. 2004-12-02 Jackson Harper * ExternTypeRefInst.cs: When converting to arrays we loose our valuetypedness. 2004-12-02 Jackson Harper * MethodDef.cs: Abstract methods don't get bodies. Even if there are bodies there. 2004-12-02 Jackson Harper * MethodDef.cs: If the type is an interface auto set fields to static (and give a warning if they are not static), and set methods to abstract virtual (and give warning if they were not already). * FieldDef.cs: * TypeDef.cs: Accessors and convience properties for getting and setting the method/field attributes. 2004-12-02 Jackson Harper * FieldDef.cs: Set the underlying type for bytearray data constants. This fixes bug #70153 and #70154 which my previous fix caused. 2004-08-01 Atsushi Enomoto * DebuggingInfo.cs : csc build fix (see bug #62230). 2004-07-27 Martin Baulig * IInstr.cs (IInstr): Made this an abstract class and not an interface, added a .ctor which takes a Location. (IInstr.Location): New public readonly field. * CodeGen.cs (CodeGen.SymbolWriter): New public property. (CodeGen.BeginSourceFile, EndSourceFile): New public methods. (CodeGen.EndMethodDef): Take a `Location' argument. (CodeGen.Write): Create debugging info if the user requested it. * MethodDef.cs (MethodDef.ctor): Added `CodeGen codegen' and `Location start' arguments. If the user requested debugging information, register ourselves with the symbol writer. (MethodDef.WriteCode): Emit debugging information. * DebuggingInfo.cs: New file. 2004-07-23 Jackson Harper * MethodDef.cs: Params are 1 based if the method is instance because of the 'this' arg. 2004-07-21 Jackson Harper * ExternTypeRefInst.cs: Use the PeapiType so that modified types will actually work. Add a Clone method so that type ref insts aren't duplicated making them modified multiple times. 2004-07-12 Jackson Harper * MethodDef.cs: Local lists are not lazyily allocated so they were getting added to every method. This is legal but wastes space. 2004-07-08 Jackson Harper * CodeGen.cs: Add assembly custom attributes to the pe file. * CustomAttr.cs: Custom attributes are now added through the pefile, this ensures that they get emitted properly. * ExternTable.cs: Allow adding custom attributes to assembly refs. 2004-06-26 Jackson Harper * TypeDef.cs: Preserve the order of fields in a class. Then after all the fields have been defined reset the order in PEAPI to the correct order. This is done so sequential layouts actually work. The order needs to be reset because it can be lost during the recursive definition phase. * MethodDef.cs: Use and ExternModule for pinvoke data's module refs. This way we don't get duplicate module refs. 2004-06-24 Jackson Harper * MethodDef.cs: Report when defining methods just like MS. * TypeDef.cs: Error message when we can't find a locla method. 2004-06-23 Jackson Harper * MethodDef.cs: sigh, another varargs fix that probably breaks other varargs tets. Someday I will get this right, I don't think today is that day though. This fix basically just makes sure to trim the sentinel off of signatures. Also eliminated some code duplication. * ParamDef.cs: Make IsSentinel work for both cases of generating a sentinel param def. 2004-06-20 Jackson Harper * SwitchInstr.cs: Allow switches with no labels. 2004-06-20 Jackson Harper * InstrTable.cs: Add .u8 opcodes for ldind and ldelem these are just aliases to their .i8 equivelents. 2004-06-19 Jackson Harper * MethodPointerTypeRef.cs: New File - represents a method pointer that is being treated as a typeref. For example method void*() in the statement castclass method void*(). 2004-06-19 Jackson Harper * InstrTable.cs: Add undocumented brnull opcode. This is really just an alias for brfalse. 2004-06-19 Jackson Harper * MethodDef.cs: Add a method to create vararg signatures from a list of typerefs that matches the algorithm for creating vararg signatures from paramdefs. This is used when creating methodref signatures. * MethodRef.cs: Use the new CreateVarargSignature method to create the methods signature if it is a vararg method. 2004-06-14 Jackson Harper * CodeGen.cs: Allow file refs to be added. * FileRef.cs: New file - represents a file ref. 2004-06-14 Jackson Harper * CodeGen.cs: Allow adding module refs. * ExternTable.cs: Add ExternModule refs. * ExternTypeRef.cs: Take an ExternRef which can be either an assmebly ref or a module ref. 2004-06-14 Jackson Harper * CodeGen.cs: Implement setting module names. 2004-05-23 Jackson Harper * MethodDef.cs: Cache vararg signatures so a new memberref is not created for each vararg pattern. 2004-05-22 Jackson Harper * InstrTable.cs: ldc.i4.M1 is aliased to ldc.i4.m1. Fixes bug #58524. 2004-05-22 Jackson Harper * GlobalMethodRef.cs: Check for sentinel properly. 2004-04-03 Jackson Harper * CodeGen.cs: cast 2004-04-02 Jackson Harper * CodeGen.cs: Allow setting assembly info. 2004-04-01 Jackson Harper * CodeGen.cs: Add a current assembly ref and methods to create/end it so we can set assembly ref attributes. * ExternTable.cs: Make the ExternAssembly public so that its attributes can be set. 2004-03-28 Jackson Harper * PeapiTypeRef.cs: Check for null bounds in bound arrays. Patch by Vladimir Vukicevic. * ModifiablyType.cs: Set names properly for bound arrays. 2004-02-18 Jackson Harper * ExternTypeRefInst.cs: New file - represents an instance of an extern type ref, used for making value type tokens. * TypeDef.cs: Add implementing classes. 2003-12-10 Jackson Harper * ModifiableType.cs: Allow the conversion list to be got/set. * ExternTypeRef.cs: Add a Clone method. Remove table modification. 2003-12-10 Jackson Harper * ExternTable.cs: Add methods to update a types name. * ExternTypeRef.cs: When a types name is modified update it in the table. 2003-12-08 Jackson Harper * ModifiableType.cs: Put modifier and class in the list in the correct order. 2003-11-18 Jackson Harper * MethodDef.cs: Add support for .zeroinit. This is just another way of initializing locals. 2003-11-17 Jackson Harper * LdstrInstr.cs: Allow strings to be created as bytearrays. 2003-10-28 Jackson Harper * ExternTable.cs: Revert back to resolving value and class types into the same table. This avoids types being resolved multiple times when classrefs are used with valuetypes. 2003-10-28 Jackson Harper * ExternTable.cs: This is now used to store ExternTypeRefs so we only create 1 for each external type. * ExternTypeRef.cs: Only create one method and field per a signature/name. 2003-10-18 Jackson Harper * ExternTable.cs: Separate class and value types into diff tables. 2003-10-18 Jackson Harper * InstrTable.cs: Use short branch instructions instead of aliasing them to the long branch instructions. 2003-10-13 Jackson Harper * MethodDef.cs: Check for null param lists in vararg methods. Fixes bug #49614. 2003-10-11 Jackson Harper * GenericTypeRef.cs: Allow Mvars to be a base type. * GenericMethodRef.cs: Basically just a wrapper around an existing method making it into a generic method. * GenericMethodSig.cs: Signature for a generic method. 2003-10-08 Jackson Harper * PeapiTypeRef.cs: Remove old hackery for adding methods to arrays, use typespecs now. 2003-10-08 Jackson Harper * InstrTable.cs: Add unbox.any instruction. * MethodDef.cs: Allow generic parameters to be added to methods. 2003-10-06 Jackson Harper * MethodInfo.cs: Use report to display no label error message. 2003-10-01 Jackson Harper * LabelInfo.cs: Fix tabbing, add ToString so labels are printed properly in error messages. 2003-09-27 Jackson Harper * MethodDef.cs: Allow PInvoke info to be added. 2003-09-21 Jackson Harper * CodeGen.cs: Add methods for adding data. CodeGen now takes a report object for giving users errors/warnings/info. * FieldDef.cs: When a data constant is assigned to a field the constant might not exist yet. So just take the constants name and look it up when writting code. * Local.cs: Starting to add some error handling. Still playing with diff ways to do this. * MethodDef.cs: Add some error handling for local var lookups * TypeDef.cs: Data is allways global so it should never be added to a class * TypeRef.cs: Error message for lookups. 2003-09-20 Jackson Harper * TypeDef.cs: Rework so multiple constraints can be added to a generic parameter. 2003-09-16 Jackson Harper * InstrTable.cs: endfault instruction (which is just endfinally with a costume on). 2003-09-15 Jackson Harper * FinallyBlock.cs: The sad thing is how long it took me to realize what was going on here... 2003-09-13 Jackson Harper * MethodInstr.cs: callvirt operation is implicitly instance. 2003-09-12 Jackson Harper * TypeRef.cs: Remove unused enum, this has been moved to the ModifiableType base class. 2003-09-08 Jackson Harper * TypeDef.cs: By default types will have System.Object as their parent type if no parent type is specified (this is what PEAPI does) however if we are assembling corlib the System.Object type will not have System.Object as its parent type. 2003-08-19 Jackson Harper * DataDef.cs: Make name public so data names can be looked up * FieldDef.cs: Stub method for adding data values * TypeDef.cs: Implement long form overrides, fix some backwords variable naming, add a method to lookup data definitions. 2003-08-19 Jackson Harper * IClassRef.cs: Removed methods that have been moved into ITypeRef * MethodDef.cs: Make some properties public, Add method to get a list of parameter types. This is used to build signatures. Alow sentinels in signatures and in param lists. Fix some tabbing. * ParamDef.cs: Expose the parameters type so they can be used when building signatures. * TypeDef.cs: Add and emit overrides. 2003-08-10 Jackson Harper * CodeGen.cs: Fix tabbing * ModifiableType.cs: Modify a types signature when the type is modified instead of waiting untill the end. Signatures need to be modified immediatly because they are used in method signatures and would fail for overloaded operations if sigs weren't modified right away. * ExternTypeRef.cs: Add signature modifications, fix some tabbing * GenericTypeInst.cs: Use ModifiableType as a base * GenericTypeRef.cs: Use ModifiableType as a base * PeapiTypeRef.cs: No longer take or modify type names. * PrimitiveTypeRef.cs: Add signature modifications, fix some tabbing. * Sentinel.cs: Add signature modifications, fix some tabbing. * TypeRef.cs: Add signature modifications, fix some tabbing. 2003-08-05 Nick Drochak * IClassRef.cs: Fix build on .NET 2003-08-03 Jackson Harper * IClassRef.cs: Add method for making types into value types * ExternTypeRef.cs: Add functionality for valuetypes * MethodDef.cs: Handle Vararg signatures individually. Fixes for new Sentinel type in vararg signatures * MethodRef.cs: Use new SentinelTypeRef instead of Sentinel type ref constant. * ParamDef.cs: New method to check if this parameter is the sentinel * TypeRef.cs: Add some functionality for creating valuetypes * Sentinel.cs: New type represents the sentinel 2003-08-03 Jackson Harper * TypeDef.cs: Make types into value types if specified. Also add the functionality to make types into Enums. TODO: Value types of nested classes. 2003-08-03 Jackson Harper * LabelInfo.cs: Move this type outside of MethodDef, because other types use LabelInfos for label references now. * BranchInstr.cs: Take a LabelInfo instead of information on a label. * HandlerBlock.cs: Take a LabelInfo instead of information on a label. * MethodDef.cs: Return LabelInfo from AddLabel methods. New method for adding a reference to a label. 2003-08-02 Jackson Harper * ExternMethodRef.cs: Remove top secret debugging code. * MethodDef.cs: Less elegant but more bugfree method of doing explicit offsets for labels. Just put the offset labels in another list and define them in another loop. 2003-08-02 Jackson Harper * IMethodRef.cs: Method refs should expose their call conv. This is needed so the call conv can be modified for the newobj operation which is implicitly instance. * ExternMethodRef.cs: Expose call conv. Don't resolve vararg methods more then once. * GlobalMethodRef.cs: Expose call conv * TypeSpecMethodRef.cs: Expose call conv * MethodInstr.cs: For newobj operations set the call conv to instance 2003-07-31 Jackson Harper * MethodDef.cs: Allow 0 offsets for labels, and make sure to only use offsets when we are supposed to. 2003-07-30 Jackson Harper * BranchInstr.cs: Allow explicit offsets for labels 2003-07-29 Jackson Harper * FilterBlock.cs: Use a handler block for the this block. This makes it easier to create filters using braces, labels, or offsets * HandlerBlock.cs: Allow handler blocks to be created using positions, offsets, and labels. * MethodDef.cs: Add methods to create labels all 3 ways, and emit labels created by each of the methods. * TryBlock.cs: Use a handler block instead of label strings. This allows all three methods of label creation to be used. 2003-07-29 Jackson Harper * IInstr.cs: Instructions now get their parent method when being emitted. * *Instr.cs: Adjust emit method to accept a methoddef 2003-07-27 Jackson Harper * CodeGen.cs: Set the assembly name when creating the PEFile. 2003-07-27 Jackson Harper * CodeGen.cs: Do not create the PEFile untill the resolve phase. This fixes the problem with ilasm creating blank files if their is a failure in the parsing phase and not being able to set the assembly name. * ExternTable.cs: Do not reference the assemblies untill after the PEFile untill the Resolve phase. 2003-07-27 Jackson Harper * ExternFieldRef.cs: Resolve as a typespec field if neccasary, make sure to not resolve more then once. * ExternMethodRef.cs: Resolve as a typespec method if neccasary * ExternTypeRef.cs: Use modifiable type as base class * FieldRef.cs: Make sure to not resolve more then once. * GlobalFieldRef.cs: Make sure to not resolve more then once. * GlobalMethodRef.cs: Make sure to not resolve more then once. * ITypeRef.cs: Types no longer need the AsClassRef method * MethodDef.cs: Only decriment param count for vararg methods if there is an ellipsis on the end of the param list. Fix little bug so return types allways get resolved. * PeapiTypeRef.cs: Use TypeRef.Ellipsis for a place holder in bound arrays instead of null * PrimitiveTypeRef.cs: Use modifiable type as a base * TypeRef.cs: Use modifable type as base, and let it do all the modifications * TypeSpecFieldRef.cs: Make sure to not resolve more then once. * ModifiableType.cs: New base class for all types. This class will handle all of the typemodification and determine whether methods should be added to the type or the types typespec. 2003-07-25 Jackson Harper * MethodDef.cs: If methods do not have the static attribute give them the instance calling convention. 2003-07-21 Jackson Harper * MethodDef.cs: Do not decremint param count for vararg methods, the ellipsis is needed later 2003-07-20 Jackson Harper * GenericTypeInst.cs: New File - A type reference to an instance of a generic type. ie Set * TypeSpecFieldRef.cs: New File - A field ref that is attached to a typespec. This can be used with modified types, and generic types. * TypeSpecMethodRef.cs: New File - A method ref that is attached to a typespec. This can be used with modified types, and generic types. * GenericTypeRef.cs: Create method refs and field refs using the new typespec classes. * ITypeRef.cs: Types should now be able to have methods and fields attached to them * PeapiTypeRef.cs: Set UseTypeSpec to true if the type is modified * PrimitiveTypeRef.cs: Add methods to attach fields and methods. This just uses the TypeSpec* classes so I don't need to create classrefs. * TypeRef.cs: Set UseTypeSpec to true if a type is modified. 2003-07-17 Jackson Harper * GenericTypeRef.cs: New File - A reference to a generic type spec. ie !0 or !1 * InstrTable.cs: Add the stelem and ldelem opcodes. 2003-07-15 Jackson Harper * TypeDef.cs: Allow adding and emitting generic type constraints. 2003-07-14 Jackson Harper * TypeDef.cs: Emit generic parameters. 2003-06-15 Jackson Harper * CodeGen.cs: Fix buglet in cache name creating (I will claim this was a typo). 2003-06-14 Jackson Harper * CodeGen.cs: When creating nested types cache their names using the parent/type method but emit their short name. 2003-06-14 Jackson Harper * CodeGen.cs: Add methods for setting corflags, subsystem, and corflags. 2003-06-14 Jackson Harper * ITypeRef.cs, PeapiTypeRef.cs, TypeRef.cs: Quick hack for custom modified types. 2003-06-08 Jackson Harper * EventDef.cs: Only add one method for addon, fire, other, and removeon 2003-06-08 Jackson Harper * TypeDef.cs: Add properties to types. * PropertyDef.cs: New file - Implementation of a type property feature 2003-06-08 Jackson Harper * TypeDef.cs: Fix silly null reference bug. 2003-06-08 Jackson Harper * EventDef.cs: New file - An event definition. * FeatureAttr.cs: New file - Attributes for features (events and properties) * MethodRef.cs: Only resolve methods once. * TypeDef.cs: Allow Events to be added to types. Also add functionality to add generic type parameters to types. The actually emission of these type parameters is commented out untill I commit my patches to PEAPI and work out the syntax of constraints. 2003-05-31 Jackson Harper * CodeGen.cs: Allow this assembly name to be set. * HandlerBlock.cs: Make label fields public so they can be accessed in a TryBlocks constructor. * MethodDef.cs: Allow random labels to be inserted at the current position. These are use for scope blocks. * TryBlock.cs: New constructor takes from and to labels as a HandlerBlock 2003-05-31 Jackson Harper * CustomAttr.cs: New file - Custom attributes * InstrTable.cs: Add stelem.r4 and stelem.r8 instructions. Add . tail to unaligned modifier. * LdtokenInstr.cs: Add type tokens. * MethodDef.cs: Fix IsVararg, add method to add custom attributes, emitting custom attributes when writing code, allow for Ellipsises in param lists, add coma between args in signatures. * ParamDef.cs: Add the Ellipsis pseudo param * PrimitiveTypeRef.cs: System.String and System.Object can be referenced without an [mscorlib] assembly prefix. * TypeDef.cs: Add Custom attributes. 2003-05-25 Jackson Harper * CodeGen.cs: Add method to resolve global vararg methods. * ExternMethodRef.cs: Resolve vararg methods * GlobalMethodRef.cs: Set calling conventions, add vararg methods * MethodDef.cs: Set calling conventions, add vararg methods * MethodRef.cs: Set calling conventions, add vararg methods * TypeDef.cs: Resolve vararg methods * TypeRef.cs: Add Ellipsis pseudo type, this should never really be used as a type, but is stored in arrays with other types. Pass call convs to methodref constructor. 2003-05-24 Jackson Harper * CatchBlock.cs: Remove typo causing to labels to be the same as from labels. * FaultBlock.cs: Remove typo causing to labels to be the same as from labels. * FilterBlock.cs: Remove typo causing to labels to be the same as from labels. * MethodDef.cs: Allow for multiple labels to point to the same line. ie: END_BLOCK: PASS: do stuff 2003-05-23 Jackson Harper * CatchBlock.cs: New file - Initial implementation of a catch block * FaultBlock.cs: New file - Initial implementation of a fault block * FilterBlock.cs: New file - Initial implementation of a filter block * FinallyBlock.cs: New file - Initial implementation of a finally block * HandlerBlock.cs: New file - A handler block is the block assosciated with a SEH clause * ISehClause: New file - Interface that structured exception handling clauses must implement. * TryBlock.cs: New file - Initial implementation only supports label form SEH. This TryBlock is added to a method as an instruction out of convenience, tryblock is not an instruction. 2003-05-22 Jackson Harper * InstrTable.cs: Add unsigned conversion instructions. 2003-05-21 Jackson Harper * CalliInstr.cs: New file - The calli instruction * Ldtoken.cs: New file - The ldtoken instruction * InstrTable.cs: ldc.i8 is a TOKEN_I8 and should be given the MiscToken.ldc_i8 value. 2003-05-18 Jackson Harper * ExternMethodRef.cs: Accept and add calling conventions. Add methods using array methods if owners are arrays, resolve methods named as .ctor. * ExternTable.cs: Add method to get value classes. * ExternTypeRef.cs: Add AsClassRef method, GetMethodRef now takes calling conventions. * IClassRef.cs: GetMethodRef now takes calling conventions * ITypeRef.cs: Add IsArray IsRef and AsClassRef methods * MethodRef.cs: Change to .ctor * PeapiTypeRef.cs: This class is no longer an ITypeRef because it cannot be converted to a IClassRef. Add IsArray and IsRef, use new Class::GetArray* methods to convert to arrays. * PrimitiveTypeRef.cs: Add method to convert to an IClassRef * TypeRef.cs: Add IsArray and IsRef, add method to convert to IClassRef. GetMethodRef now takes calling conventions 2003-05-11 Jackson Harper * MethodDef.cs: Add named param table and methods to get named param positions. Add method to get named local variables slot number. Make sure param_lists aren't null when defining them. Add specialname and rtspecialname attributes if the method being defined is named '.ctor' or '.cctor'. Add new method for creating signatures using a list of typerefs. * GlobalMethodRef.cs: Use new CreateSignature method that takes an array of typerefs. * MethodRef.cs: Use new CreateSignature method * InstrTable.cs: Use INSTR_LOCAL and INSTR_PARAM tokens for instructions that take local and param operands. 2003-05-11 Jackson Harper * TypeDef.cs: Add size and packing information 2003-05-10 Jackson Harper * IFieldRef.cs: New file - interface field references must implement * ExternFieldRef.cs: New file - Reference to a field in another assembly * FieldRef.cs: New file - Reference to a field in this assembly * GlobalFieldRef.cs: New file - Reference to a global field * FieldInstr.cs: New file - Instruction that takes a field instruction * CodeGen.cs: Add method to resolve global methods * ExternTypeRef.cs: Add method to get method references * FieldDef.cs: Allow methods to be resolved before being defined * IClassRef.cs: Add method to get field references. * TypeDef.cs: Add method to resolve member fields. * TypeRef.cs: Add method to get field references 2003-05-10 Jackson Harper * GlobalMethodRef.cs: New file - A reference to a global method * CodeGen.cs: Store global methods and fields in hashtables to make lookup easier. Add method to resolve global methods. 2003-05-10 Jackson Harper * MethodDef.cs: Allways set max stack 2003-05-10 Jackson Harper * ExternTable.cs: Alias corlib to mscorlib since these seem to get used interchangably 2003-05-10 Jackson Harper * IMethodRef.cs: New file - Interface that method references must implement * ExternMethodRef.cs: New file - Reference to a method in another assembly * Local.cs: New file - A Local variable * MethodInstr.cs: New file - an instruction that takes a method reference operand * IClassRef.cs: Add method to get a method reference from a class reference * MethodDef.cs: Add ability to resolve methods before defining them, add max stack, locals, and entry point. Make CreateSignature method public and static so other classes can use it. * TypeDef.cs: Store methods and fields in hashtables so they can be easily retrieved, add method to resolve member methods. * TypeRef.cs: Add method for resolving member methods. * ExternTypeRef.cs: Add methods to get classref and methodrefs * MethodRef.cs: New file - Reference to a method in this assembly. 2003-05-07 Jackson Harper * TypeInstr.cs: New file - implementation of instructions that take a single type instruction. 2003-05-06 Jackson Harper * SwitchInstr.cs: New file - implementation of switch instructions 2003-05-05 Jackson Harper * MethodDef.cs: Add ability to add and emit labels * BranchInstr.cs: New file - Branch instructions 2003-05-04 Jackson Harper * LdcInstr.cs: New file - lcd* instructions * MiscInstr.cs: New file - Just an enum that gives me constant values for instructions PEAPI does not define in an enum * InstrTable.cs: Use new MiscInstr constants instead of string values. 2003-05-01 Jackson Harper * CodeGen.cs: Define the contents of types after all types have been resolved, this avoids the infinite loop that would occur if a type was a member of its base type. * TypeDef.cs: Method to define contents after being defined. 2003-05-01 Jackson Harper * TypeManager.cs: Check if type is defined before defining it. 2003-05-01 Jackson Harper * CodeGen.cs: Add outer classes to typedefs if necesary * InstrTable.cs: ldtoken instruction is a INSTR_TOK token * TypeDef.cs: Add outer class property 2003-04-30 Jackson Harper * MethodDef.cs: Accept and emit instructions. * CodeGen.cs: Fix typo * IInstr.cs: New file - Interface for instructions that are added to methods * IntInstr.cs: New file - Instruction that takes a single int param * LdstrInstr.cs: New file - ldstr instruction (the only instruction that takes a string parameter) 2003-04-28 Jackson Harper * InstrTable.cs: Much simpler system. All tokens go into one hashtable now. There is no reason to have them seperated out. 2003-04-20 Jackson Harper * CodeGen.cs: Add method to add data * FieldDef.cs: Add method to set a fields value * TypeDef.cs: Add method to add data * DataDef.cs: New file - Definition of a data constant 2003-04-18 Jackson Harper * FieldDef.cs: Change peapi fielddef name. * MethodDef.cs: Change peapi methoddef name. 2003-04-17 Jackson Harper * MethodDef.cs: New file - definition of a method. * ParamDef.cs: New file - definition of a parameter to a method * TypeDef.cs: Add method definitions, set intransit flag to false before defining members, so a false circular reference is not created. * CodeGen.cs: Add methods to add method definitions 2003-04-17 Jackson Harper * ExternTypeRef.cs: external types are classrefs 2003-04-17 Jackson Harper * PeapiTypeRef.cs: New file - base wrapper for type refs that are just peapi types. * PrimitiveTypeRef.cs: New file - A primitive type (char, int, string) 2003-04-17 Jackson Harper * TypeRef.cs: Rewrite - Typerefs are now resolved after parsing. * TypeManager.cs: Rewrite - Just a simple table for looking up typedefs * ExternTable.cs: Create ClassRef's instead of Classes * Location.cs: Make compile * CodeGen.cs: Use new tree system 2003-04-17 Jackson Harper * ExternTypeRef.cs: New file - Represents a reference to a type in an external assembly * FieldDef.cs: New file - Represents a field definition * IClassRef.cs: New file - Interface that classrefs must implement. This needs some more thought though because once a classref has been modified it is no longer a classref. * ITypeRef.cs: New file - Interface that references to types must implement * TypeDef.cs: New file - Represents the a class definition, and will hold all of the classes members. 2003-04-07 Jackson Harper * TypeRef.cs: Return FieldDef when adding a field def to a class 2003-04-01 Jackson Harper * TypeRef.cs: Add flag for making types pinned 2003-04-01 Jackson Harper * ClassTable.cs: Do not append a . to names that are not in a namespace * CodeGen.cs: Handle nested classes 2003-03-30 Jackson Harper * ExternTable.cs: Remove some unsed fields. 2003-03-30 Jackson Harper * ExternTable.cs: Add method to lookup classes with a full name, instead of having to have namespace and name seperate. * ClassTable.cs: Make method that seprates full names into name/namespaces public. 2003-03-30 Jackson Harper * InstrTable.cs: Add Calli, detabify 2003-03-29 Jackson Harper * InstrTable.cs: Add branch ops switch, and lc.r*, also fix some typos for other ops. 2003-03-17 Jackson Harper * ClassTable.cs: Set defined flag and type attributes for referenced classes when they are defined. 2003-03-17 Jackson Harper * MethodTable.cs: Add method to Check if all methods have been defined, set referenced methods properties when defining them * FieldTable.cs: Add method to check if all fields have been defined, set referenced fields properties when defining them * ClassTable.cs: Make sure all methods and fields are defined. 2003-03-16 Jackson Harper * MethodTable.cs: Fire events when methods are defined and referenced 2003-03-15 Jackson Harper * ClassTable.cs: Classes now store field tables * CodeGen.cs: Add methods to add fields and get field references 2003-03-15 Jackson Harper * FieldTable.cs: New file, holds a classes fields 2003-03-15 Jackson Harper * InstrTable.cs: Add FieldOp instructions 2003-03-15 Jackson Harper * InstrTable.cs: Add ldstr instruction 2003-03-15 Jackson Harper * CodeGen.cs: Add method to get method references. * MethodTable.cs: Complete GetReference method * InstrTable.cs: Add MethodOps (instructions that take a method ref param) 2003-03-14 Jackson Harper * InstrTable.cs: Add TypeOps (instructions that take a type param) 2003-03-14 Jackson Harper * InstrTable.cs: Add IntOps (instructions that take an integer param) 2003-03-13 Jackson Harper * InstrTable.cs: Fix instructions that have dots in their name 2003-03-13 Jackson Harper * CodeGen.cs: Add code buffer for il instructions when a new method is added. * InstrTable.cs: New file, this is a table of all the instructions (just simple instructions right now) 2003-03-13 Jackson Harper * CodeGen.cs: Set current method when a new method is added. 2003-03-12 Jackson Harper * ClassTable.cs: Add Method tables to Class tables, add method to get a class's method table. * CodeGen.cs: Add Method to add methods :p * MethodTable.cs: Add file, this class is used to add methods to a class. 2003-03-11 Jackson Harper * TypeRef.cs: New file, used for pairing types and their names. 2003-03-09 Jackson Harper * ExternTable.cs: Do not verify the existence of external types 2003-03-08: Jackson Harper * CodeGen.cs: Add ExternTable property * ExternTable.cs: New file, this will is used for pulling types and methods from external assemblies. 2003-03-06 Jackson Harper * ClassTable.cs, CodeGen.cs: Add methods to allow types to inherit from another type. 2003-03-06 Jackson Harper * ClassTable.cs: Add method to check for undefined types 2003-03-06 Jackson Harper * CodeGen.cs: Use class table for adding type definitions * ClassTable.cs: Return ClassDef when defining types 2003-03-06 Jackson Harper * ClassTable.cs: Add method for adding class definitions to the the table. 2003-03-6 Jackson Harper * CodeGen.cs: Reconfigure to work with new PEAPI emission system 2003-03-6 Jackson Harper * ClassTable.cs: Add file, this is a 'table' for storing classes * Location.cs: Add file, this will eventually be used for marking locations in IL files 2003-02-10 Jackson Harper * Method.cs: Add method to set parameters, set parameters when defining type * Class.cs: Fix very silly bug in GetMethod method 2003-02-09 Jackson Harper * Class.cs: Resolve Methods before emiting * InstrBase.cs: Take a Class instead of CodeGen when emiting * Method.cs: Replace MethodInfo property with MethodBuilder property, Add resolve method * Instructions.cs: Take Class instead of CodeGen when emitting, get member methods from Class. * TypeManager.cs: Add set indexer 2003-02-09 Jackson Harper * Instructions.cs: Use TypeManager to lookup types 2003-02-08 Jackson Harper * TypeManager.cs: Fix error parsing type names * Method.cs: Display the name of types that can't be found 2003-02-08 Jackson Harper * TypeManager.cs: Add file * CodeGen.cs: Add TypeManager attribute * InstrBase.cs: Take a CodeGen in Emit method * Instructions.cs: Take a CodeGen in Emit method, handle arg lists better * Method.cs: Handle local variables better 2003-02-08 Jackson Harper * Method.cs: Add functionality to define local variables * Instructions.cs: Add newobj instruction, cleanup call instruction 2003-02-03 Jackson Harper * AssemblyNameStore.cs: Added file 2003-02-02 Jackson Harper * Instructions.cs: Resolve parameters types in a more proper manner. 2003-02-02 Jackson Harper * Class.cs: Don't try to emit methods if we don't have any * Class.cs: Test for entry point of methods, and set Assembly entrypoint * CodeGen.cs: Add method to set an Assemblys entry point * Method.cs: Add IsEntryPoint property * Method.cs Add MethodInfo property, and set this while Emiting * Instructions.cs: Add new InstrCall instruction