Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ EmitNewArrayExpression()

void System.Linq.Expressions.Compiler.LambdaCompiler.EmitNewArrayExpression ( Expression expr)
inlineprivate

Definition at line 1740 of file LambdaCompiler.cs.

1741 {
1742 NewArrayExpression newArrayExpression = (NewArrayExpression)expr;
1744 int count = expressions.Count;
1745 if (newArrayExpression.NodeType == ExpressionType.NewArrayInit)
1746 {
1747 Type elementType = newArrayExpression.Type.GetElementType();
1748 _ilg.EmitArray(elementType, count);
1749 for (int i = 0; i < count; i++)
1750 {
1752 _ilg.EmitPrimitive(i);
1754 _ilg.EmitStoreElement(elementType);
1755 }
1756 }
1757 else
1758 {
1759 for (int j = 0; j < count; j++)
1760 {
1763 _ilg.EmitConvertToType(expression.Type, typeof(int), isChecked: true, this);
1764 }
1765 _ilg.EmitArray(newArrayExpression.Type);
1766 }
1767 }
virtual void Emit(OpCode opcode)
static readonly OpCode Dup
Definition OpCodes.cs:77

References System.Linq.Expressions.Compiler.LambdaCompiler._ilg, System.Linq.count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Reflection.Emit.OpCodes.Dup, System.elementType, System.Reflection.Emit.ILGenerator.Emit(), and System.Linq.Expressions.Compiler.LambdaCompiler.EmitExpression().

Referenced by System.Linq.Expressions.Compiler.LambdaCompiler.EmitExpression().