コード例 #1
0
 public void CleanUpUnusedDeclarations()
 {
     V_1 = this.referenceToDeclarationStatementMap.GetEnumerator();
     try
     {
         while (V_1.MoveNext())
         {
             V_2 = V_1.get_Current();
             V_3 = V_2.get_Key();
             this.context.get_MethodContext().RemoveVariable(V_3);
             V_4 = V_2.get_Value();
             V_5 = V_4.get_Parent() as BlockStatement;
             if (!this.IsOptimisableAssignment(V_4))
             {
                 V_6 = (V_4.get_Expression() as BinaryExpression).get_Right();
                 if (!this.CanExistInStatement(V_6))
                 {
                     continue;
                 }
                 if (V_6.get_CodeNodeType() == 87)
                 {
                     V_6 = (V_6 as ParenthesesExpression).get_Expression();
                 }
                 V_7 = new ExpressionStatement(V_6);
                 V_8 = V_5.get_Statements().IndexOf(V_4);
                 V_5.AddStatementAt(V_8 + 1, V_7);
                 this.TransferLabel(V_4);
                 V_5.get_Statements().RemoveAt(V_8);
             }
             else
             {
                 this.TransferLabel(V_4);
                 dummyVar0 = V_5.get_Statements().Remove(V_4);
             }
         }
     }
     finally
     {
         ((IDisposable)V_1).Dispose();
     }
     V_0 = new HashSet <VariableDefinition>();
     V_9 = this.context.get_MethodContext().get_Variables().GetEnumerator();
     try
     {
         while (V_9.MoveNext())
         {
             V_10 = V_9.get_Current();
             if (this.bannedVariables.Contains(V_10))
             {
                 continue;
             }
             dummyVar1 = V_0.Add(V_10);
         }
     }
     finally
     {
         V_9.Dispose();
     }
     V_11 = V_0.GetEnumerator();
     try
     {
         while (V_11.MoveNext())
         {
             V_12 = V_11.get_Current();
             this.context.get_MethodContext().RemoveVariable(V_12);
         }
     }
     finally
     {
         ((IDisposable)V_11).Dispose();
     }
     return;
 }