Make many helpers, factories and tables static in Microsoft.CSharp (dotnet/corefx#27044)
* Have TypeArray in charge of the empty TypeArray singleton
* Make TypeArray allocation a static responsibility of TypeArray
* Remove some orphaned members.
Mostly BSYMMGR-returning members that had been used to allocate
TypeArrays
* Make members static were possible.
Those that can already be easily made static. Includes removing some
members that this makes no longer necessary.
* Remove unused parameters
Since some are of the types we'll be making static, and such parameters
will have to go anyway.
* Make TypeTable static
And more conventional names within TypeTable.
* More TypeManager state & methods to static
* Make SYMTBL.Key an immutable struct.
* SYMTBL completely static and renamed to SymbolStore
More conventional name, and doesn't clash with other SymbolTable class.
* GetWinRTCollectionIfacesAll to property.
* SymFactory static class.
* Remove PredefinedTypes._symbolManager field
Only used in assertion.
* Remove assert comparison with this in GetAggregate
Assert is the only reason to not be static, allows a cascade of more
changes to static.
* Make InternalsVisibleTo check static.
* Make cycle of instance methods static
Take quite a large set of methods which must be instance because of
cyclic instance dependencies, and make them all static.
Removes dependency in AggregateSymbol and NullableType on TypeManager
instances.
* Replace GetAggTypeSym with virtual method on CType.
Merged with existing GetAts on NullableType. Comment says this would be
nice, and indeed it would, and its easy now.
* Make those members that can now be static, static.
* Remove orphaned members and fields.
* PredefinedMembers entirely static.
* Remove UserStringBuilder.m_buildingInProgress
Only used in asserts, just assert on whether m_strBuilder is null or
not.
Also rename m_strBuilder to _strBuilder to be more conventional.
* Favour returning over out in UserStringBuilder
And favour clearing StringBuilder over creating another.
* Make ErrorHandling completely static.
Creating UserStringBuilder instances on demand.
* TypeManager static.
* Make CNullable methods static and merge directly into ExpressionBinder
Don't cache method and property, as they're already cached.
* Don't preload types.
Either they'll be loaded soon anyway, or else it's a wasted effort.
* Move CompareTypes into Better.cs
* Remove BSYMMGR.LookupAggMember
Just call into SymbolStore.LookupSym
* Move LookupNextSym logic into Symbol
* Remove BSYMMGR and GlobalSymbolContext
No longer any use.
* ExprFactory static
* SymbolLoader static
* CSemanticChecker static
* Don't pre-emptively load System.Object
Will be loaded as a base of the first type encountered anyway.
* SymbolTable static
* More methods can be made static
* Remove orphaned method.
* Move methods for getting MemberInfos from expressions into those expressions
* Replace ExpressionTreeCallRewriter.GetObject with virtual property in Expr
* TypeArray tidy-up.
* Pass ExpressionBinder to operator delegates, and make them static.
Allows array to be created once statically, rather than on each
instance construction.
* Create RuntimeBinder, ExpressionBinder and BindingContext per operation
These are now very lightweight, so it's simpler to create them anew
each time rather than overwriting the values in the BindingContext.
* Make RuntimeBinder, ExpressionBinder and BindingContext structs
No need to allocate on the heap.
* Remove AggregateDeclaration
We only ever care about the AggregateSymbol it relates to.
(The two aren't really separate in dynamic code, where there aren't
really declarations).
* Remove IsChecked and CallingContext from C# binders.
Now not used as they are passed to RuntimeBinder on construction,
except for CallingContext remaining in CSharpInvokeMemberBinder for use
in deferring.
* Make RecordBinOpSigFromArgs static.
A last member that can be made static.
* Make static-member-only classes static.
* Make NameHashKey a readonly struct.
Commit migrated from https://github.com/dotnet/corefx/commit/
b7d1ae93c179510991f75709c3c3c1d3e3d062c1