Browse Source

Fix inlining after expression peephole transformations.

pull/100/head
Daniel Grunwald 15 years ago
parent
commit
a673a3fec1
  1. 9
      ICSharpCode.Decompiler/ILAst/PeepholeTransform.cs

9
ICSharpCode.Decompiler/ILAst/PeepholeTransform.cs

@ -47,8 +47,13 @@ namespace ICSharpCode.Decompiler.ILAst @@ -47,8 +47,13 @@ namespace ICSharpCode.Decompiler.ILAst
// apply expr transforms to top-level expr in block
bool modified = ApplyExpressionTransforms(ref expr, exprTransforms);
block.Body[i] = expr;
if (modified)
new ILInlining(method).InlineIfPossible(block, i, aggressive: false);
if (modified) {
ILInlining inlining = new ILInlining(method);
if (inlining.InlineIfPossible(block, i, aggressive: true)) {
i -= inlining.InlineInto(block, i, aggressive: false) - 1;
continue;
}
}
}
// apply block transforms
foreach (var t in blockTransforms) {

Loading…
Cancel
Save