+2002-08-19 Martin Baulig <martin@gnome.org>
+
+ * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
+ here from IMemberFinder and don't implement this interface anymore.
+ (DeclSpace.MemberCache): Moved here from IMemberFinder.
+
+ * typemanager.cs (IMemberFinder): This interface is now only used by
+ classes which actually support the member cache.
+ (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
+ since we only put DeclSpaces into this Hashtable.
+ (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
+ a dynamic type and TypeHandle.GetTypeHandle() otherwise.
+
+2002-08-16 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (ICachingMemberFinder): Removed.
+ (IMemberFinder.MemberCache): New property.
+ (TypeManager.FindMembers): Merged this with RealFindMembers().
+ This function will never be called from TypeManager.MemberLookup()
+ so we can't use the cache here, just the IMemberFinder.
+ (TypeManager.MemberLookup_FindMembers): Check whether the
+ IMemberFinder has a MemberCache and call the cache's FindMembers
+ function.
+ (MemberCache): Rewrote larger parts of this yet another time and
+ cleaned it up a bit.
+
+2002-08-15 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs (LoadArgs): Support quoting.
+
+ (Usage): Show the CSC-like command line arguments.
+
+ Improved a few error messages.
+
+2002-08-15 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (IMemberContainer.Type): New property.
+ (IMemberContainer.IsInterface): New property.
+
+ The following changes are conditional to BROKEN_RUNTIME, which is
+ defined at the top of the file.
+
+ * typemanager.cs (MemberCache.MemberCache): Don't add the base
+ class'es members, but add all members from TypeHandle.ObjectType
+ if we're an interface.
+ (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
+ is the current type.
+ (MemberCache.CacheEntry.Container): Removed this field.
+ (TypeHandle.GetMembers): Include inherited members.
+
+2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * typemanager.cs: fixed compilation and added a comment on a field that
+ is never used.
+
+2002-08-15 Martin Baulig <martin@gnome.org>
+
+ * class.cs (ConstructorInitializer.Resolve): In the
+ Expression.MemberLookup call, use the queried_type as
+ invocation_type.
+
+ * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
+ declared' attribute, it's always true.
+ (IMemberContainer.Parent, IMemberContainer.Name): New properties.
+ (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
+ temporary wrapper for FindMembers which tells MemberLookup whether
+ members from the base classes are included in the return value.
+ This will go away soon.
+ (TypeManager.MemberLookup): Use this temporary hack here; once the
+ new MemberCache is completed, we don't need to do the DeclaredOnly
+ looping here anymore since the MemberCache will take care of this.
+ (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
+ (MemberCache): When creating the MemberCache for a class, get
+ members from the current class and all its base classes.
+ (MemberCache.CacheEntry.Container): New field. This is a
+ temporary hack until the Mono runtime is fixed to distinguish
+ between ReflectedType and DeclaringType. It allows us to use MCS
+ with both the MS runtime and the unfixed Mono runtime without
+ problems and without accecting performance.
+ (MemberCache.SearchMembers): The DeclaredOnly looping from
+ TypeManager.MemberLookup is now done here.
+
+2002-08-14 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (MyStructInfo.MyStructInfo): Don't call
+ Type.GetFields on dynamic types but get the fields from the
+ corresponding TypeContainer.
+ (MyStructInfo.GetStructInfo): Added check for enum types.
+
+ * typemanager.cs (MemberList.IsSynchronized): Implemented.
+ (MemberList.SyncRoot): Implemented.
+ (TypeManager.FilterWithClosure): No need to check permissions if
+ closure_start_type == closure_invocation_type, don't crash if
+ closure_invocation_type is null.
+
+2002-08-13 Martin Baulig <martin@gnome.org>
+
+ Rewrote TypeContainer.FindMembers to use a member cache. This
+ gives us a speed increase of about 35% for the self-hosting MCS
+ build and of about 15-20% for the class libs (both on GNU/Linux).
+
+ * report.cs (Timer): New class to get enhanced profiling. This
+ whole class is "TIMER" conditional since it remarkably slows down
+ compilation speed.
+
+ * class.cs (MemberList): New class. This is an IList wrapper
+ which we're now using instead of passing MemberInfo[]'s around to
+ avoid copying this array unnecessarily.
+ (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
+ (ICachingMemberFinder, IMemberContainer): New interface.
+ (TypeManager.FilterWithClosure): If `criteria' is null, the name
+ has already been checked, otherwise use it for the name comparision.
+ (TypeManager.FindMembers): Renamed to RealMemberFinder and
+ provided wrapper which tries to use ICachingMemberFinder.FindMembers
+ if possible. Returns a MemberList, not a MemberInfo [].
+ (TypeHandle): New class, implements IMemberContainer. We create
+ one instance of this class per type, it contains a MemberCache
+ which is used to do the member lookups.
+ (MemberCache): New class. Each instance of this class contains
+ all members of a type and a name-based hash table.
+ (MemberCache.FindMembers): This is our new member lookup
+ function. First, it looks up all members of the requested name in
+ the hash table. Then, it walks this list and sorts out all
+ applicable members and returns them.
+
+2002-08-13 Martin Baulig <martin@gnome.org>
+
+ In addition to a nice code cleanup, this gives us a performance
+ increase of about 1.4% on GNU/Linux - not much, but it's already
+ half a second for the self-hosting MCS compilation.
+
+ * typemanager.cs (IMemberFinder): New interface. It is used by
+ TypeManager.FindMembers to call FindMembers on a TypeContainer,
+ Enum, Delegate or Interface.
+ (TypeManager.finder_to_member_finder): New PtrHashtable.
+ (TypeManager.finder_to_container): Removed.
+ (TypeManager.finder_to_delegate): Removed.
+ (TypeManager.finder_to_interface): Removed.
+ (TypeManager.finder_to_enum): Removed.
+
+ * interface.cs (Interface): Implement IMemberFinder.
+
+ * delegate.cs (Delegate): Implement IMemberFinder.
+
+ * enum.cs (Enum): Implement IMemberFinder.
+
+ * class.cs (TypeContainer): Implement IMemberFinder.
+
+2002-08-12 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
+
+2002-08-12 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (ITypeExpression): New interface for expressions which
+ resolve to a type.
+ (TypeExpression): Renamed to TypeLookupExpression.
+ (Expression.DoResolve): If we're doing a types-only lookup, the
+ expression must implement the ITypeExpression interface and we
+ call DoResolveType() on it.
+ (SimpleName): Implement the new ITypeExpression interface.
+ (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
+ hack, the situation that we're only looking up types can't happen
+ anymore when this method is called. Moved the type lookup code to
+ DoResolveType() and call it.
+ (SimpleName.DoResolveType): This ITypeExpression interface method
+ is now doing the types-only lookup.
+ (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
+ (ResolveFlags): Added MaskExprClass.
+
+ * expression.cs (MemberAccess): Implement the ITypeExpression
+ interface.
+ (MemberAccess.DoResolve): Added support for a types-only lookup
+ when we're called via ITypeExpression.DoResolveType().
+ (ComposedCast): Implement the ITypeExpression interface.
+
+ * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
+ Expression.Resolve() with ResolveFlags.Type instead.
+
+2002-08-12 Martin Baulig <martin@gnome.org>
+
+ * interface.cs (Interface.Define): Apply attributes.
+
+ * attribute.cs (Attribute.ApplyAttributes): Added support for
+ interface attributes.
+
+2002-08-11 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Block.Emit): Only check the "this" variable if we
+ do not always throw an exception.
+
+ * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
+ whether the property has a set accessor.
+
+2002-08-11 Martin Baulig <martin@gnome.org>
+
+ Added control flow analysis support for structs.
+
+ * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
+ with control flow analysis turned off.
+ (IVariable): New interface.
+ (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
+ returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
+ (FieldExpr.DoResolve): Resolve the instance expression with flow
+ analysis turned off and do the definite assignment check after the
+ resolving when we know what the expression will resolve to.
+
+ * expression.cs (LocalVariableReference, ParameterReference):
+ Implement the new IVariable interface, only call the flow analysis
+ code if ec.DoFlowAnalysis is true.
+ (This): Added constructor which takes a Block argument. Implement
+ the new IVariable interface.
+ (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
+ DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
+ This does the definite assignment checks for struct members.
+
+ * class.cs (Constructor.Emit): If this is a non-static `struct'
+ constructor which doesn't have any initializer, call
+ Block.AddThisVariable() to tell the flow analysis code that all
+ struct elements must be initialized before control returns from
+ the constructor.
+
+ * statement.cs (MyStructInfo): New public class.
+ (UsageVector.this [VariableInfo vi]): Added `int field_idx'
+ argument to this indexer. If non-zero, check an individual struct
+ member, not the whole struct.
+ (FlowBranching.CheckOutParameters): Check struct members.
+ (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
+ overloaded versions of these methods which take an additional
+ `int field_idx' argument to check struct members.
+ (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
+ overloaded versions of these methods which take an additional
+ `string field_name' argument to check struct member.s
+ (VariableInfo): Implement the IVariable interface.
+ (VariableInfo.StructInfo): New public property. Returns the
+ MyStructInfo instance of the variable if it's a struct or null.
+ (Block.AddThisVariable): New public method. This is called from
+ Constructor.Emit() for non-static `struct' constructor which do
+ not have any initializer. It creates a special variable for the
+ "this" instance variable which will be checked by the flow
+ analysis code to ensure that all of the struct's fields are
+ initialized before control returns from the constructor.
+ (UsageVector): Added support for struct members. If a
+ variable/parameter is a struct with N members, we reserve a slot
+ in the usage vector for each member. A struct is considered fully
+ initialized if either the struct itself (slot 0) or all its
+ members are initialized.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * driver.cs (Driver.MainDriver): Only report an error CS5001
+ if there were no compilation errors.
+
+ * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
+ `UnsafeContext' property to determine whether the parent is in
+ unsafe context rather than checking the parent's ModFlags:
+ classes nested in an unsafe class are unsafe as well.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (UsageVector.MergeChildren): Distinguish between
+ `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
+ we return. Added test17() and test18() to test-154.cs.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.FilterWithClosure): If we have
+ Family access, make sure the invoking type isn't a subclass of the
+ queried type (that'd be a CS1540).
+
+ * ecore.cs (Expression.MemberLookup): Added overloaded version of
+ this method which takes an additional `Type invocation_type'.
+
+ * expression.cs (BaseAccess.DoResolve): Use the base type as
+ invocation and query type.
+ (MemberAccess.DoResolve): If the lookup failed and we're about to
+ report a CS0122, try a lookup with the ec.ContainerType - if this
+ succeeds, we must report a CS1540.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
+ (MethodGroupExpr): Implement the IMemberExpr interface.
+
+ * expression (MemberAccess.ResolveMemberAccess): No need to have
+ any special code for MethodGroupExprs anymore, they're now
+ IMemberExprs.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
+ Family, FamANDAssem and FamORAssem permissions.
+ (TypeManager.IsSubclassOrNestedChildOf): New public method.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
+ (UsageVector.MergeChildren): `break' breaks unless we're in a switch
+ or loop block.
+
+Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * driver.cs: implemented /resource option to embed managed resources.
+
+2002-08-07 Martin Baulig <martin@gnome.org>
+
+ * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
+ (FieldBase.HasFieldInitializer): New public property.
+ (FieldBase.GetInitializerExpression): New public method. Resolves and
+ returns the field initializer and makes sure it is only resolved once.
+ (TypeContainer.EmitFieldInitializers): Call
+ FieldBase.GetInitializerExpression to get the initializer, this ensures
+ that it isn't resolved multiple times.
+
+ * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
+ the resolving process (SimpleName/MemberLookup) that we're currently
+ emitting a field initializer (which must not access any instance members,
+ this is an error CS0236).
+
+ * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
+ argument, if the `IsFieldInitializer' flag is set, we must report and
+ error CS0236 and not an error CS0120.
+
+2002-08-07 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (IMemberExpr): New public interface.
+ (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
+ (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
+ if the expression is an IMemberExpr.
+
+ * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
+ to be null, implicitly default to `this' if we're non-static in
+ this case. Simplified the code a lot by using the new IMemberExpr
+ interface. Also fixed bug #28176 here.
+
+2002-08-06 Martin Baulig <martin@gnome.org>
+
+ * cs-parser.jay (SimpleLookup): Removed. We need to create
+ ParameterReferences during semantic analysis so that we can do a
+ type-only search when resolving Cast, TypeOf and SizeOf.
+ (block): Pass the `current_local_parameters' to the Block's
+ constructor.
+
+ * class.cs (ConstructorInitializer): Added `Parameters parameters'
+ argument to the constructor.
+ (ConstructorInitializer.Resolve): Create a temporary implicit
+ block with the parameters.
+
+ * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
+ references here if we aren't doing a type-only search.
+
+ * statement.cs (Block): Added constructor which takes a
+ `Parameters parameters' argument.
+ (Block.Parameters): New public property.
+
+ * support.cs (InternalParameters.Parameters): Renamed `parameters'
+ to `Parameters' and made it public readonly.
+
+2002-08-06 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.Warning): Made this public as well.
+
+ * report.cs (Report.Debug): Print the contents of collections.
+
+2002-08-06 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
+ used to tell Resolve() which kinds of expressions it may return.
+ (Expression.Resolve): Added overloaded version of this method which
+ takes a `ResolveFlags flags' argument. This can be used to tell
+ Resolve() which kinds of expressions it may return. Reports a
+ CS0118 on error.
+ (Expression.ResolveWithSimpleName): Removed, use Resolve() with
+ ResolveFlags.SimpleName.
+ (Expression.Error118): Added overloaded version of this method which
+ takes a `ResolveFlags flags' argument. It uses the flags to determine
+ which kinds of expressions are allowed.
+
+ * expression.cs (Argument.ResolveMethodGroup): New public method.
+ Resolves an argument, but allows a MethodGroup to be returned.
+ This is used when invoking a delegate.
+
+ * TODO: Updated a bit.
+
+2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ Fixed compilation with csc.
+
+ * ecore.cs: Expression.Error made public. Is this correct? Should
+ Warning be made public too?
+
+ * expression.cs: use ea.Location instead of ea.loc.
+ [FIXME: Filed as bug #28607: MCS must report these errors.]
+
+2002-08-06 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.loc): Moved the location here instead of
+ duplicating it in all derived classes.
+ (Expression.Location): New public property.
+ (Expression.Error, Expression.Warning): Made them non-static and
+ removed the location argument.
+ (Expression.Warning): Added overloaded version which takes an
+ `int level' argument.
+ (Expression.Error118): Make this non-static and removed the
+ expression and location arguments.
+ (TypeExpr): Added location argument to the constructor.
+
+ * expression.cs (StaticCallExpr): Added location argument to
+ the constructor.
+ (Indirection, PointerArithmetic): Likewise.
+ (CheckedExpr, UnCheckedExpr): Likewise.
+ (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
+ (StringPtr): Likewise.
+
+
2002-08-05 Martin Baulig <martin@gnome.org>
+ * expression.cs (BaseAccess.DoResolve): Actually report errors.
+
+ * assign.cs (Assign.DoResolve): Check whether the source
+ expression is a value or variable.
+
+ * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
+ while resolving the corresponding blocks.
+
+ * interface.cs (Interface.GetInterfaceTypeByName): Actually report
+ an error, don't silently return null.
+
* statement.cs (Block.AddVariable): Do the error reporting here
and distinguish between CS0128 and CS0136.
(Block.DoResolve): Report all unused labels (warning CS0164).