|
|
@ -189,6 +189,8 @@ namespace ICSharpCode.Decompiler.IL |
|
|
|
ExpressionTreeCast, |
|
|
|
ExpressionTreeCast, |
|
|
|
/// <summary>Use of user-defined && or || operator.</summary>
|
|
|
|
/// <summary>Use of user-defined && or || operator.</summary>
|
|
|
|
UserDefinedLogicOperator, |
|
|
|
UserDefinedLogicOperator, |
|
|
|
|
|
|
|
/// <summary>ILAst representation of a short-circuiting binary operator inside a dynamic expression.</summary>
|
|
|
|
|
|
|
|
DynamicLogicOperatorInstruction, |
|
|
|
/// <summary>ILAst representation of a binary operator inside a dynamic expression (maps to Binder.BinaryOperation).</summary>
|
|
|
|
/// <summary>ILAst representation of a binary operator inside a dynamic expression (maps to Binder.BinaryOperation).</summary>
|
|
|
|
DynamicBinaryOperatorInstruction, |
|
|
|
DynamicBinaryOperatorInstruction, |
|
|
|
/// <summary>ILAst representation of a unary operator inside a dynamic expression (maps to Binder.UnaryOperation).</summary>
|
|
|
|
/// <summary>ILAst representation of a unary operator inside a dynamic expression (maps to Binder.UnaryOperation).</summary>
|
|
|
@ -4952,6 +4954,94 @@ namespace ICSharpCode.Decompiler.IL |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
namespace ICSharpCode.Decompiler.IL |
|
|
|
namespace ICSharpCode.Decompiler.IL |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
/// <summary>ILAst representation of a short-circuiting binary operator inside a dynamic expression.</summary>
|
|
|
|
|
|
|
|
public sealed partial class DynamicLogicOperatorInstruction : DynamicInstruction |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
public static readonly SlotInfo LeftSlot = new SlotInfo("Left", canInlineInto: true); |
|
|
|
|
|
|
|
ILInstruction left; |
|
|
|
|
|
|
|
public ILInstruction Left { |
|
|
|
|
|
|
|
get { return this.left; } |
|
|
|
|
|
|
|
set { |
|
|
|
|
|
|
|
ValidateChild(value); |
|
|
|
|
|
|
|
SetChildInstruction(ref this.left, value, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public static readonly SlotInfo RightSlot = new SlotInfo("Right"); |
|
|
|
|
|
|
|
ILInstruction right; |
|
|
|
|
|
|
|
public ILInstruction Right { |
|
|
|
|
|
|
|
get { return this.right; } |
|
|
|
|
|
|
|
set { |
|
|
|
|
|
|
|
ValidateChild(value); |
|
|
|
|
|
|
|
SetChildInstruction(ref this.right, value, 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected sealed override int GetChildCount() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return 2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected sealed override ILInstruction GetChild(int index) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
switch (index) { |
|
|
|
|
|
|
|
case 0: |
|
|
|
|
|
|
|
return this.left; |
|
|
|
|
|
|
|
case 1: |
|
|
|
|
|
|
|
return this.right; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
throw new IndexOutOfRangeException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected sealed override void SetChild(int index, ILInstruction value) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
switch (index) { |
|
|
|
|
|
|
|
case 0: |
|
|
|
|
|
|
|
this.Left = value; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 1: |
|
|
|
|
|
|
|
this.Right = value; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
throw new IndexOutOfRangeException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected sealed override SlotInfo GetChildSlot(int index) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
switch (index) { |
|
|
|
|
|
|
|
case 0: |
|
|
|
|
|
|
|
return LeftSlot; |
|
|
|
|
|
|
|
case 1: |
|
|
|
|
|
|
|
return RightSlot; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
throw new IndexOutOfRangeException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public sealed override ILInstruction Clone() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var clone = (DynamicLogicOperatorInstruction)ShallowClone(); |
|
|
|
|
|
|
|
clone.Left = this.left.Clone(); |
|
|
|
|
|
|
|
clone.Right = this.right.Clone(); |
|
|
|
|
|
|
|
return clone; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override void AcceptVisitor(ILVisitor visitor) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
visitor.VisitDynamicLogicOperatorInstruction(this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override T AcceptVisitor<T>(ILVisitor<T> visitor) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return visitor.VisitDynamicLogicOperatorInstruction(this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override T AcceptVisitor<C, T>(ILVisitor<C, T> visitor, C context) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return visitor.VisitDynamicLogicOperatorInstruction(this, context); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected internal override bool PerformMatch(ILInstruction other, ref Patterns.Match match) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var o = other as DynamicLogicOperatorInstruction; |
|
|
|
|
|
|
|
return o != null && this.left.PerformMatch(o.left, ref match) && this.right.PerformMatch(o.right, ref match); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
namespace ICSharpCode.Decompiler.IL |
|
|
|
{ |
|
|
|
{ |
|
|
|
/// <summary>ILAst representation of a binary operator inside a dynamic expression (maps to Binder.BinaryOperation).</summary>
|
|
|
|
/// <summary>ILAst representation of a binary operator inside a dynamic expression (maps to Binder.BinaryOperation).</summary>
|
|
|
|
public sealed partial class DynamicBinaryOperatorInstruction : DynamicInstruction |
|
|
|
public sealed partial class DynamicBinaryOperatorInstruction : DynamicInstruction |
|
|
@ -6499,6 +6589,10 @@ namespace ICSharpCode.Decompiler.IL |
|
|
|
{ |
|
|
|
{ |
|
|
|
Default(inst); |
|
|
|
Default(inst); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected internal virtual void VisitDynamicLogicOperatorInstruction(DynamicLogicOperatorInstruction inst) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Default(inst); |
|
|
|
|
|
|
|
} |
|
|
|
protected internal virtual void VisitDynamicBinaryOperatorInstruction(DynamicBinaryOperatorInstruction inst) |
|
|
|
protected internal virtual void VisitDynamicBinaryOperatorInstruction(DynamicBinaryOperatorInstruction inst) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Default(inst); |
|
|
|
Default(inst); |
|
|
@ -6873,6 +6967,10 @@ namespace ICSharpCode.Decompiler.IL |
|
|
|
{ |
|
|
|
{ |
|
|
|
return Default(inst); |
|
|
|
return Default(inst); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected internal virtual T VisitDynamicLogicOperatorInstruction(DynamicLogicOperatorInstruction inst) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return Default(inst); |
|
|
|
|
|
|
|
} |
|
|
|
protected internal virtual T VisitDynamicBinaryOperatorInstruction(DynamicBinaryOperatorInstruction inst) |
|
|
|
protected internal virtual T VisitDynamicBinaryOperatorInstruction(DynamicBinaryOperatorInstruction inst) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return Default(inst); |
|
|
|
return Default(inst); |
|
|
@ -7247,6 +7345,10 @@ namespace ICSharpCode.Decompiler.IL |
|
|
|
{ |
|
|
|
{ |
|
|
|
return Default(inst, context); |
|
|
|
return Default(inst, context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected internal virtual T VisitDynamicLogicOperatorInstruction(DynamicLogicOperatorInstruction inst, C context) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return Default(inst, context); |
|
|
|
|
|
|
|
} |
|
|
|
protected internal virtual T VisitDynamicBinaryOperatorInstruction(DynamicBinaryOperatorInstruction inst, C context) |
|
|
|
protected internal virtual T VisitDynamicBinaryOperatorInstruction(DynamicBinaryOperatorInstruction inst, C context) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return Default(inst, context); |
|
|
|
return Default(inst, context); |
|
|
@ -7390,7 +7492,8 @@ namespace ICSharpCode.Decompiler.IL |
|
|
|
"array.to.pointer", |
|
|
|
"array.to.pointer", |
|
|
|
"string.to.int", |
|
|
|
"string.to.int", |
|
|
|
"expression.tree.cast", |
|
|
|
"expression.tree.cast", |
|
|
|
"user.logic.op", |
|
|
|
"user.logic.operator", |
|
|
|
|
|
|
|
"dynamic.logic.operator", |
|
|
|
"dynamic.binary.operator", |
|
|
|
"dynamic.binary.operator", |
|
|
|
"dynamic.unary.operator", |
|
|
|
"dynamic.unary.operator", |
|
|
|
"dynamic.convert", |
|
|
|
"dynamic.convert", |
|
|
|