* LambdaExpression.cs, EmitContext.cs: refactor the emit context to
handle the fact that lambdas are compiled in a general context where
they share globals but are also able to use parameters from parent lambdas.
(Although parameter sharing is not implemented yet).
* BinaryExpression.cs (fix converted coalesce case to use the lambda
compilation code).
svn path=/trunk/mcs/; revision=106310
* LambdaExpression.cs, EmitContext.cs: When encountering a lambda
inside an ET, compile it as a read of a global. Based on a patch
by Roei Erez <[email protected]>
svn path=/trunk/mcs/; revision=103177
* LambdaExpression.cs: move checks to Expression
* Expression.cs: apply check for both typed and untyped lambda
creation, so that the constructor does not throws exception.
Needed to create instances of Expression<> for untyped lambda
factory method. Fixes#386322.
svn path=/trunk/mcs/; revision=102398
* LambdaExpression.cs: use the new standardified IsAssignableTo,
fixes ExpressionTest_NewArrayBounds.TestArrayAssignability.
svn path=/trunk/mcs/; revision=98632
* *.cs: Move the different Emit* helpers to EmitContext,
so that they get used more naturally by the non Expression
types.
svn path=/trunk/mcs/; revision=97992
* BinaryExpression.cs (EmitCoalesce): Add support for emitting
code for Coalesce.
TODO: this does not use the "Conversion" Lambda, which am not sure
who generates this or what it is used for.
(EmitLogical): Fix a couple of bugs in AndAlso, OrElse.
* Expression.cs: Add support for Coalesce.
(BinaryCoreCheck): Move more checking here, instead of the helper
routines, will remove them next.
* LambdaExpression.cs (Compile): Create the delegate last, so we
manage to save the assembly while debugging in case of error
svn path=/trunk/mcs/; revision=93480
* Expression.cs (BinaryCoreCheck): Add checking for a few
operators here (to avoid doing a second pass, handles AndAlso and
OrElse).
(AndAlso, OrElse): Add some code.
* BinaryExpression.cs: Instead of using GetValueOrDefault use
get_Value, as we already probed for the lack of value.
Split out support for And/Or to a separate routine as the code is
not very easy to share with the arithmetics code.
svn path=/trunk/mcs/; revision=93471
* Start code generation for nullables, currently this generates
incorrect code for things like:
Expression<Func<int?, int?, int?>> e2 = (a, b) => a + b;
e2.Compile ().Invoke (null, 3))
This should return null, but returns something else.
* Introduce LINQ_DBG env variable, which generates a linq file in
/tmp; It currently does not work as well as it should, as the
Func<> parameters do not mwatch the generated method.
Investigate.
svn path=/trunk/mcs/; revision=93369
Introduce support for Nullable arguments, no code is generated for
these yet, its only tests + node creation behavior at this point.
* Expression.cs (BinaryCoreCheck): Do not allow "int?" and "int"
as operators, they must both be nullable.
NullableTypes in the arguments are transformed into the underlying
values when doing the method validation.
svn path=/trunk/mcs/; revision=93368
* BinaryExpression.cs: Add support for emitting code for some
operators (ported from the Mono C# compiler).
Add tests.
svn path=/trunk/mcs/; revision=93231
Beginning of code generation framework for Linq.Expressions.
Some code was borrowed by from the C# compiler
* Expression_T.cs: Fill in the blanks.
* LambdaExpression.cs: Validation of parameters mostly, a tiny bit
of codegen.
* ConstantExpression.cs: Mostly done, need to write tests for
non-fundamental types and other ValueType initializations.
svn path=/trunk/mcs/; revision=93222