Fixes for compiling mPhoto:
[mono.git] / mcs / mcs / ChangeLog
index ba0b4fa9ac3b9a0d6e53eef72c9405e2ba6473e5..fd30a8df217d94498cece1c948f4e868aab0f6eb 100755 (executable)
@@ -1,3 +1,611 @@
+2003-05-12  Miguel de Icaza  <miguel@ximian.com>
+
+       * support.cs (InternalParameters.ParameterType): Return the
+       ExternalType of the parameter.
+
+       * parameter.cs (Parameter.ExternalType): drop the two arguments,
+       they were unused.
+
+s2003-05-11  Miguel de Icaza  <miguel@ximian.com>
+
+       * class.cs (MethodData.Define): Do not set the `newslot' on
+       interface members, if they are also flagged as "override".
+
+       * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
+       better code for ++i and i++.  This only works for static fields
+       and local variables.
+
+       * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
+       want to pull the DeclSpace out of the builder_to_declspace instead
+       of the TypeBuilder (like in TypeContainer.FindMembers).
+
+       * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
+       instead of LookupTypeContainer.  Fixes the crash on .NET for
+       looking up interface members.
+
+       * const.cs: Create our own emit context during the Definition
+       stage, so that constants are evaluated in the proper context, when
+       a recursive definition happens.
+
+2003-05-11  Martin Baulig  <martin@ximian.com>
+
+       * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
+       new block for a switch section.
+       (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
+       the adding/lookup in the switch block.  Fixes #39828.
+
+2003-05-09  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
+       functionality: I needed to convert the data after I had performed
+       the add/sub operation into the operands type size.
+
+       * ecore.cs (ImplicitReferenceConversion): When boxing an interface
+       pass the type for the box operation, otherwise the resulting
+       object would have been of type object.
+
+       (BoxedCast): Add constructor to specify the type to box as.
+
+2003-05-07  Miguel de Icaza  <miguel@ximian.com>
+
+       * iterators.cs: I was reusing the `count' variable inadvertently,
+       take steps to not allow this to happen.
+
+2003-05-06  Miguel de Icaza  <miguel@ximian.com>
+
+       * attribute.cs (Attribute.Resolve): Params attributes are encoded
+       by creating an array at the point where the params starts and
+       putting all those arguments there, then adjusting the size of the
+       array.
+
+2003-05-05  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs (New.AddressOf): Implement interface
+       IMemoryLocation.  This is used when the `new' operator is used in
+       the context of an invocation to a method on a value type.
+
+       See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
+       example. 
+
+       * namespace.cs: Also check the using aliases here.
+
+       * driver.cs: Move the test for using validity after the types have
+       been entered, so we do a single pass that also includes the using
+       aliases. 
+
+       * statement.cs (Try.Resolve): Avoid crashing if there is a failure
+       in the regular case.   CreateSiblingForFinally is doing extra
+       error checking.
+
+       * attribute.cs (GetAttributeArgumentExpression): Store the result
+       on an out value, and use the return value to indicate failure
+       instead of using null (which is a valid return for Constant.GetValue).
+
+       * statement.cs: Perform the analysis flow for the increment
+       portion after the statement, because this will be the real flow of
+       execution.  Fixes #42385
+
+       * codegen.cs (EmitContext.EmitArgument,
+       EmitContext.EmitStoreArgument): New helper functions when the
+       RemapToProxy flag is set.
+
+       * expression.cs (ParameterReference.EmitLdarg): Expose this useful
+       function.
+
+       Add support for remapping parameters. 
+
+       * iterators.cs: Propagate parameter values;  Store parameter
+       values in the proxy classes.
+       
+2003-05-04  Miguel de Icaza  <miguel@ximian.com>
+
+       * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
+       need a proxy reference;  I do not know what I was thinking
+
+       * cs-parser.jay (constructor_initializer): catch another error,
+       and display nice message.
+       
+       (field_declaration): catch void field declaration
+       to flag a better error. 
+
+       * class.cs (MemberBase.CheckBase): Report an error instead of a
+       warning if a new protected member is declared in a struct. 
+       (Field.Define): catch the error of readonly/volatile.
+
+       * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
+
+       (FieldExpr.AddressOf): ditto.  Catch error where the address of a
+       volatile variable is taken
+
+2003-05-02  Miguel de Icaza  <miguel@ximian.com>
+
+       * statement.cs (Fixed.Resolve): Report an error if we are not in
+       an unsafe context.
+
+2003-05-01  Miguel de Icaza  <miguel@ximian.com>
+
+       * typemanager.cs: reuse the code that handles type clashes for
+       delegates and enumerations.
+
+       * class.cs (Report28): Always report.
+
+       * expression.cs (EncodeAsAttribute): Allow nulls here.
+
+2003-04-28  Miguel de Icaza  <miguel@ximian.com>
+
+       * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
+       the functionality for testing whether an expression is valid for
+       an attribute here.  Also handle the case of arrays of elements
+       being stored. 
+
+       * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
+       encoding a linear array into an array of objects that are suitable
+       to be passed to an CustomAttributeBuilder.
+
+       * delegate.cs: Check unsafe types being used outside of an Unsafe context.
+
+       * ecore.cs: (FieldExpr): Handle field remapping here.
+
+       * iteratators.cs: Pass the instance variable (if the method is an
+       instance method) to the constructors, so we can access the field
+       variables on the class.
+
+       TODO: Test this with structs.  I think the THIS variable on
+       structs might have to be a pointer, and not a refenrece
+
+2003-04-27  Miguel de Icaza  <miguel@ximian.com>
+
+       * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
+       local variables to fields in a proxy class.
+
+       * iterators.cs (PopulateProxy): Rename our internal fields to
+       <XXX>.  
+       Create a <THIS> field if we are an instance method, so we can
+       reference our parent container variables.
+       (MapVariable): Called back from the EmitContext code to enter a
+       new variable to field mapping into the proxy class (we just create
+       a FieldBuilder).
+
+       * expression.cs
+       (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
+       for using the remapped locals to fields.
+
+       I placed the code here, because that gives the same semantics to
+       local variables, and only changes the Emit code.
+
+       * statement.cs (Fixed.Resolve): it is not allowed to have fixed
+       statements inside iterators.
+       (VariableInfo): Add a FieldBuilder for the cases when we are
+       remapping local variables to fields in a proxy class
+
+       * ecore.cs (SimpleNameResolve): Avoid testing two times for
+       current_block != null.
+
+       * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
+       not cope with strings, as it has been moved to the
+       TableSwitchEmit.  Fixed bug in switch generation.
+
+       * expression.cs (New.DoResolve): Provide more context for the user
+       when reporting an error.
+
+       * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
+       pointers. 
+
+       * expression.cs (MemberAccess.DoResolve): When we get a type back,
+       check the permissions for it.  Note than in a type-resolution
+       context the check was already present in DeclSpace.ResolveType,
+       but was missing from the MemberAccess.
+
+       (ArrayCreation.CheckIndices): warn if the user has
+       more nested levels of expressions, but there are no more
+       dimensions specified.  Avoids crash on bug 41906.
+
+2003-04-26  Miguel de Icaza  <miguel@ximian.com>
+
+       * statement.cs (Block): replace Implicit bool, for a generic
+       flags.   
+       New flag: `Unchecked'.  This is used during the EmitMeta phase
+       (which is out-of-line with the regular Resolve/Emit process for a
+       statement, as this is done ahead of time, but still gets a chance
+       to call constant resolve).
+       
+       (Block.Flags): new enum for adding a new flag.
+
+       (Block.EmitMeta): track the state of unchecked.
+       
+       (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
+       to enable constant resolution to work there as well.
+
+2003-04-22  Miguel de Icaza  <miguel@ximian.com>
+
+       * typemanager.cs (ienumerable_type): Also look up
+       System.Collections.IEnumerable. 
+
+2003-04-21  Miguel de Icaza  <miguel@ximian.com>
+
+       TODO: Test more than one conditional per method.
+       
+       * class.cs (Indexer.Define): Report the location where the user is
+       referencing the unsupported feature.
+
+       (MethodData): Overload the use of `conditionals' to
+       minimize the creation of needless ArrayLists.   This saves roughly
+       212kb on my machine.
+
+       (Method): Implement the new IIteratorContainer interface.
+       (Method.SetYields): Implement the method by setting the ModFlags
+       to contain METHOD_YIELDS.
+       
+       * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
+       which just got set to null.
+
+       * iterators.cs: New file.
+
+       (Yield, YieldBreak): New statements.
+
+       * statement.cs (Return.Resolve): Flag an error if we are used in
+       an iterator method.
+
+       * codegen.cs (InIterator): New flag set if the code is being
+       compiled in an iterator method.
+
+       * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
+       internal modifier, and we just use it to avoid adding extra
+       fields, as this is seldom used.  
+
+       * cs-parser.jay: Add yield_statement (yield and yield break).
+
+       * driver.cs: New flag -v2 to turn on version 2 features. 
+
+       * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
+       hashtable when v2 is enabled.
+
+2003-04-20  Miguel de Icaza  <miguel@ximian.com>
+
+       * typemanager.cs (TypeManager.NamespaceClash): Use to check if
+       there is already a namespace defined with this name.
+
+       (TypeManager.InitCoreTypes): Remove the temporary workaround, as
+       people upgraded their corlibs.
+
+       (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
+       always use fully qualified types, no need to use the compiler
+       front end.
+
+       (TypeManager.IsNamespace): Use binarysearch.
+       
+       * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
+       AddDelegate): I did not quite use the new IsValid API properly: I
+       have to pass the short-name and the fullname.  I was passing only
+       the basename instead of the fullname sometimes. 
+
+       (TypeContainer.DefineType): call NamespaceClash.
+
+       * interface.cs (Interface.DefineType): use NamespaceClash before
+       defining the type.
+
+       * delegate.cs (Delegate.DefineType): use NamespaceClash before
+       defining the type.
+
+       * enum.cs: (Enum.DefineType): use NamespaceClash before
+       defining the type.
+
+       * typemanager.cs (: 3-line patch that gives us some tasty 11%
+       speed increase.  First, use the negative_hits cache when we get a
+       negative.  Second, add the type with its full original name
+       instead of the new . and + encoded name (reflection uses + to
+       separate type from a nested type).  Use LookupTypeReflection
+       directly which bypasses the type->name hashtable (that we already
+       know does not contain the type.
+       
+       * decl.cs (DeclSpace.ResolveTypeExpr): track the
+       location/container type. 
+
+       * driver.cs: When passing utf8, use directly the UTF8Encoding.
+
+2003-04-19  Miguel de Icaza  <miguel@ximian.com>
+
+       * decl.cs (ResolveTypeExpr): Mirror check acess here too.
+
+       * delegate.cs (NewDelegate.Resolve): Test whether an instance
+       method is being referenced in the method group from a static
+       context, and report error 120 if so.
+
+       * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
+       Error118. 
+
+       * typemanager.cs: Add intermediate namespaces (if a namespace A.B
+       is created, we create the A namespace).
+
+       * cs-parser.jay: A namespace also introduces a DeclarationFound.
+       Fixes #41591
+
+2003-04-18  Miguel de Icaza  <miguel@ximian.com>
+
+       * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
+       invocation to ModuleBuilder.GetType with the same values will
+       return a new type instance, so we need to cache its return
+       values. 
+
+       * expression.cs (Binary.ResolveOperator): Only allow the compare
+       operators on enums if they are of the same type.
+
+       * ecore.cs (Expression.ImplicitReferenceConversion): handle target
+       types of ValueType on their own case.  Before we were giving them
+       the same treatment as objects.
+
+       * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
+       fullname.  Short name is used to compare against container name.
+       Fullname is used to check against defined namespace names.
+       
+       * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
+       AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
+
+       (Method.CheckBase): Call parent.
+       (MemberBase.CheckBase): Check for protected members on sealed
+       classes.
+       (PropertyBase.CheckBase): Call parent.
+       (Field.Define): Call parent.
+
+       * report.cs: Negative error codes are now mapped to 8000 - code,
+       so that the display is render more nicely.
+
+       * typemanager.cs: Do not use try/catch, instead report a regular
+       error. 
+
+       (GetPointerType, GetReferenceType): These methods provide
+       mechanisms to obtain the T* and T& from a T.  We had the code
+       previously scattered around the code base, and it also used
+       TypeManager.LookupType that would go through plenty of caches.
+       This one goes directly to the type source.
+
+       In some places we did the Type.GetType followed by
+       ModuleBuilder.GetType, but not in others, so this unifies the
+       processing as well.
+
+       * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
+       statements now that we have namespace information.
+
+       * typemanager.cs (IsNamespace): New method, returns whether the
+       string presented is a namespace or not.
+
+       (ComputeNamespaces): New public entry point, computes the list of
+       available namespaces, using the GetNamespaces API call in Mono, or
+       the slower version in MS.NET.   
+
+       Now before we start the semantic analysis phase, we have a
+       complete list of namespaces including everything that the user has
+       provided.
+
+       Deleted old code to cache namespaces in .nsc files.
+
+2003-04-17  Miguel de Icaza  <miguel@ximian.com>
+
+       * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
+       class/struct location definition Location for the implicit
+       constructor location.
+
+       (Operator.Define): Use the location of the operator for the
+       implicit Method definition.
+
+       (Constructor.Emit): use the constructor location for the implicit
+       base initializer constructor.
+
+       * ecore.cs: Remove ITypeExpression.  This interface is now gone,
+       and the Expression class now contains two new methods:
+
+       ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
+       isolate type lookup from the rest of the resolution process.
+
+       Since we use Expressions to hold type definitions due to the way
+       we parse the input we have historically overloaded Resolve to
+       perform the Type lookups if a special flag is passed.  Now this is
+       eliminated and two methods take their place. 
+       
+       The differences in the two methods between xStep and xTerminal is
+       that xStep is involved in our current lookup system that uses
+       SimpleNames to compose a name, while xTerminal is used just to
+       catch the case where the simplename lookup failed.
+       
+2003-04-16  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs (ResolveMemberAccess): Remove redundant code.
+       TypeExpr expressions are always born fully resolved.
+
+       * interface.cs (PopulateMethod): Do not lookup the types twice.
+       We were doing it once during SemanticAnalysis and once during
+       PopulateMethod.
+
+       * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
+       in local variable type definitions, were being returned as a
+       SimpleName (we decomposed everything into a string), that is
+       because primary_expression was being used instead of a type in the
+       grammar (reduce/reduce conflicts).
+
+       The part that was wrong is that we converted the expression into a
+       string (an oversimplification in one hand, compounded with primary
+       expressions doing string concatenation).
+
+       So things like:
+
+       A.B.C [] x;
+
+       Would return "A.B.C[]" as a SimpleName.  This stopped things like
+       using clauses from working on this particular context.  And a type
+       was being matched directly against "A.B.C[]".
+
+       We now use the correct approach, and allow for ComposedCast to be
+       part of the unary expression.  So the "A.B.C []" become a composed
+       cast of "A.B.C" (as a nested group of MemberAccess with a
+       SimpleName at the end) plus the rank composition "[]". 
+
+       Also fixes 35567
+       
+2003-04-10  Miguel de Icaza  <miguel@ximian.com>
+
+       * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
+       for the access level checking.
+
+       * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
+       `TypeContainer container', because I kept getting confused when I
+       was debugging this code.
+
+       * expression.cs (Indexers): Instead of tracking getters/setters,
+       we now track them in parallel.  We create one arraylist less, but
+       most importantly it is possible now for the LValue code to find a
+       matching get for a set.
+
+       (IndexerAccess.DoResolveLValue): Update the code.
+       GetIndexersForType has been modified already to extract all the
+       indexers from a type.  The code assumed it did not.
+
+       Also make the code set the correct return type for the indexer.
+       This was fixed a long time ago for properties, but was missing for
+       indexers.  It used to be void_type.
+
+       (Binary.Emit): Test first for doubles instead of
+       floats, as they are more common.
+
+       (Binary.EmitBranchable): Use the .un version of the branch opcodes
+       when dealing with floats and the <=, >= operators.  This fixes bug
+       #39314 
+
+       * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
+       to load the array value by emitting a load on the foreach variable
+       type.  This was incorrect.  
+
+       We now emit the code to load an element using the the array
+       variable type, and then we emit the conversion operator.
+
+       Fixed #40176
+
+2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
+
+       * attribute.cs: Avoid allocation of ArrayLists in the common case.
+
+2003-04-09  Miguel de Icaza  <miguel@ximian.com>
+
+       * class.cs (MethodSignature.InheritableMemberSignatureCompare):
+       test for protection before we test for signatures. 
+
+       (MethodSignature.ToString): implement.
+
+       * expression.cs (Unary.TryReduceNegative): Add missing minus sign
+       to the case where we reduced into a LongConstant.
+
+       * decl.cs (CheckAccessLevel): If the type is an array, we can not
+       depend on whether the information is acurrate, because the
+       Microsoft runtime will always claim that the array type is public,
+       regardless of the real state.
+
+       If the type is a pointer, another problem happens: the type is
+       reported as non-public in Microsoft.  
+
+       In both cases we have to call CheckAccessLevel recursively with
+       the underlying type as the argument to be tested.
+
+2003-04-08  Miguel de Icaza  <miguel@ximian.com>
+
+       * assign.cs (Assign.Emit): If we are dealing with a compound
+       assignment expression, we should use the code path that stores the
+       intermediate result in a temporary value.  This fixes #40903.
+
+       *expression.cs (Indirection.ToString): Provide ToString method for
+       debugging. 
+       
+2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
+
+        * class.cs: Null out fields holding references to Block objects so
+        they can be garbage collected.
+
+        * expression.cs (OverloadResolve): Remove unused local.
+
+2003-04-07  Martin Baulig  <martin@ximian.com>
+
+       * codegen.cs (EmitContext.CurrentFile): New public field.
+       (EmitContext.Mark): Use the CurrentFile to check whether the
+       location is in the correct file.
+       (EmitContext.EmitTopBlock): Initialize CurrentFile here.
+
+2003-04-07  Martin Baulig  <martin@ximian.com>
+
+       * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
+
+       * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
+       location.  [FIXME: The location argument which gets passed to this
+       method is sometimes wrong!]
+
+2003-04-07  Nick Drochak <ndrochak@gol.com>
+
+       * codegen.cs: Be more verbose when we can't find the symbol writer dll.
+
+2003-04-07  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs (Indirection.EmitAssign): We were using the
+       temporary, but returning immediately instead of continuing the
+       EmitAssing flow.
+
+2003-04-06  Martin Baulig  <martin@ximian.com>
+
+       * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
+       if it's a nested child, but also deriving from the outer class.
+       See test 190.cs.
+
+       * typemanager.cs (IsNestedChildOf): Make this work if it's a
+       nested child, but also deriving from the outer class.  See
+       test-190.cs.
+       (FilterWithClosure): We may access private members of the outer
+       class if we're a nested child and deriving from the outer class.
+       (RealMemberLookup): Only set `closure_private_ok' if the
+       `original_bf' contained BindingFlags.NonPublic.
+
+2003-04-05  Martin Baulig  <martin@ximian.com>
+
+       * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
+
+2003-04-02  Miguel de Icaza  <miguel@ximian.com>
+
+       * class.cs (Event.Define): Do not allow abstract events to have
+       initializers. 
+
+2003-04-01  Miguel de Icaza  <miguel@ximian.com>
+
+       * cs-parser.jay: Add error productions for ADD/REMOVE missing a
+       block in event declarations.
+
+       * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
+       value type, get its address.
+
+       * expression.cs (Is.Emit): For action `LeaveOnStack' we were
+       leaving a class on the stack instead of a boolean value (int
+       0/1).  Change the code so we compare against null, and then the
+       result against zero.
+
+       * class.cs (TypeContainer.GetClassBases): We were checking for the
+       parent class being sealed too late.
+
+       * expression.cs (Binary.Emit): For <= and >= when dealing with
+       floating point values, use cgt.un and clt.un instead of cgt and
+       clt alone.
+
+2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
+
+       * statement.cs: Apply the same optimization as MS: skip the 
+       GetEnumerator returning an IEnumerator, and use the one returning a 
+       CharEnumerator instead. This allows us to avoid the try-finally block 
+       and the boxing.
+
+2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
+
+       * cs-parser.jay: Attributes cannot be applied to
+                        namespaces. Fixes #40473
+
+2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * class.cs:
+       (Add*): check if the name is valid using the full name for constants,
+       fields, properties and events.
+
 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
 
        * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow