Browse Source

Keep copy propagation enabled

pull/734/head
Daniel Grunwald 9 years ago
parent
commit
07e2493645
  1. 2
      ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs
  2. 2
      ICSharpCode.Decompiler/IL/Transforms/CopyPropagation.cs

2
ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

@ -60,7 +60,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -60,7 +60,7 @@ namespace ICSharpCode.Decompiler.CSharp
new ConditionDetection(),
new ILInlining(),
new TransformInlineAssignment(),
// new CopyPropagation(),
new CopyPropagation(),
new InlineCompilerGeneratedVariables(),
new ExpressionTransforms(), // must run once before "the loop" to allow RemoveDeadVariablesInit
new RemoveDeadVariableInit(), // must run after ExpressionTransforms because it does not handle stobj(ldloca V, ...)

2
ICSharpCode.Decompiler/IL/Transforms/CopyPropagation.cs

@ -78,6 +78,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -78,6 +78,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
case OpCode.LdsFlda:
// All address-loading instructions always return the same value for a given operand/argument combination,
// so they can be safely copied.
// ... except for LdElema and LdFlda, because those might throw an exception, and we don't want to
// change the place where the exception is thrown.
return true;
case OpCode.LdLoc:
var v = ((LdLoc)value).Variable;

Loading…
Cancel
Save