|
|
|
@ -307,26 +307,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms |
|
|
|
return FindLoadInNext(expr, v, expressionBeingMoved, out loadInst) == true; |
|
|
|
return FindLoadInNext(expr, v, expressionBeingMoved, out loadInst) == true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets whether arg can be un-inlined out of stmt.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
internal static bool CanUninline(ILInstruction arg, ILInstruction stmt) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Debug.Assert(arg.IsDescendantOf(stmt)); |
|
|
|
|
|
|
|
for (ILInstruction inst = arg; inst != stmt; inst = inst.Parent) { |
|
|
|
|
|
|
|
if (!inst.SlotInfo.CanInlineInto) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
// Check whether re-ordering with predecessors is valid:
|
|
|
|
|
|
|
|
int childIndex = inst.ChildIndex; |
|
|
|
|
|
|
|
for (int i = 0; i < childIndex; ++i) { |
|
|
|
|
|
|
|
ILInstruction predecessor = inst.Parent.Children[i]; |
|
|
|
|
|
|
|
if (!SemanticHelper.MayReorder(arg, predecessor)) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Finds the position to inline to.
|
|
|
|
/// Finds the position to inline to.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
|