diff --git a/Decompiler.csproj b/Decompiler.csproj index 3c1ce0799..cb0c705ae 100644 --- a/Decompiler.csproj +++ b/Decompiler.csproj @@ -52,7 +52,6 @@ - diff --git a/lib/cecil-0.6/src/Mono.Cecil/Mono.Cecil.csproj b/lib/cecil-0.6/src/Mono.Cecil/Mono.Cecil.csproj index 9793991b5..222aadcb6 100644 --- a/lib/cecil-0.6/src/Mono.Cecil/Mono.Cecil.csproj +++ b/lib/cecil-0.6/src/Mono.Cecil/Mono.Cecil.csproj @@ -375,4 +375,4 @@ - + \ No newline at end of file diff --git a/src/AstMetodBodyBuilder.cs b/src/AstMetodBodyBuilder.cs index 9f5d8a8cc..262bc78fe 100644 --- a/src/AstMetodBodyBuilder.cs +++ b/src/AstMetodBodyBuilder.cs @@ -18,16 +18,16 @@ namespace Decompiler static Dictionary localVarTypes = new Dictionary(); static Dictionary localVarDefined = new Dictionary(); - public static MyBlockStatement CreateMetodBody(MethodDefinition methodDef) + public static BlockStatement CreateMetodBody(MethodDefinition methodDef) { AstMetodBodyBuilder builder = new AstMetodBodyBuilder(); builder.methodDef = methodDef; return builder.CreateMetodBody(); } - public MyBlockStatement CreateMetodBody() + public BlockStatement CreateMetodBody() { - Ast.MyBlockStatement astBlock = new Ast.MyBlockStatement(); + Ast.BlockStatement astBlock = new Ast.BlockStatement(); methodDef.Body.Simplify(); @@ -89,11 +89,11 @@ namespace Decompiler yield return Ast.MyGotoStatement.Create(node, fallThroughNode); } } else if (node is AcyclicGraph) { - Ast.MyBlockStatement blockStatement = new Ast.MyBlockStatement(); + Ast.BlockStatement blockStatement = new Ast.BlockStatement(); blockStatement.Children.AddRange(TransformNodes(node.Childs)); yield return blockStatement; } else if (node is Loop) { - Ast.MyBlockStatement blockStatement = new Ast.MyBlockStatement(); + Ast.BlockStatement blockStatement = new Ast.BlockStatement(); blockStatement.Children.AddRange(TransformNodes(node.Childs)); yield return new Ast.ForStatement( null, @@ -119,7 +119,7 @@ namespace Decompiler // Swap the method bodies ifElseStmt.Condition = new Ast.UnaryOperatorExpression(new Ast.ParenthesizedExpression(ifElseStmt.Condition), UnaryOperatorType.Not); - Ast.MyBlockStatement trueBlock = new Ast.MyBlockStatement(); + Ast.BlockStatement trueBlock = new Ast.BlockStatement(); // The block entry code trueBlock.Children.Add(Ast.MyGotoStatement.Create(node, conditionalNode.Condition.FallThroughBasicBlock)); // Sugested content @@ -127,7 +127,7 @@ namespace Decompiler ifElseStmt.TrueStatement.Add(trueBlock); trueBlock.Parent = ifElseStmt; - Ast.MyBlockStatement falseBlock = new Ast.MyBlockStatement(); + Ast.BlockStatement falseBlock = new Ast.BlockStatement(); // The block entry code falseBlock.Children.Add(oldTrueBody); // Sugested content diff --git a/src/MyAst/MyBlockStatement.cs b/src/MyAst/MyBlockStatement.cs deleted file mode 100644 index 64d5145ee..000000000 --- a/src/MyAst/MyBlockStatement.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; - -using Ast = ICSharpCode.NRefactory.Ast; -using Decompiler.ControlFlow; - -namespace ICSharpCode.NRefactory.Ast -{ - public class MyBlockStatement: BlockStatement - { - ChildrenCollection wrapper; - - public class ChildrenCollection: System.Collections.ObjectModel.Collection - { - MyBlockStatement myStmt; - - public void AddRange(IEnumerable items) - { - foreach(INode node in items) { - Add(node); - } - } - - protected override void InsertItem(int index, INode item) - { - item.Parent = myStmt; - base.InsertItem(index, item); - } - - protected override void SetItem(int index, INode item) - { - item.Parent = myStmt; - base.SetItem(index, item); - } - - public ChildrenCollection(MyBlockStatement myStmt, IList nodes): base(nodes) - { - this.myStmt = myStmt; - } - } - - public new ChildrenCollection Children { - get { - return wrapper; - } - } - - public MyBlockStatement() - { - this.wrapper = new ChildrenCollection(this, base.Children); - } - } -} diff --git a/src/Transforms/Ast/RemoveEmptyElseBody.cs b/src/Transforms/Ast/RemoveEmptyElseBody.cs index 6321ff0e3..e7e8b22e7 100644 --- a/src/Transforms/Ast/RemoveEmptyElseBody.cs +++ b/src/Transforms/Ast/RemoveEmptyElseBody.cs @@ -25,7 +25,7 @@ namespace Decompiler.Transforms.Ast { base.VisitIfElseStatement(ifElseStatement, data); if (ifElseStatement.FalseStatement.Count == 1 && - ifElseStatement.FalseStatement[0] is MyBlockStatement && + ifElseStatement.FalseStatement[0] is BlockStatement && ifElseStatement.FalseStatement[0].Children.Count == 0) { ifElseStatement.FalseStatement.Clear();