private void MarkOptimizationAndCaseBlocks(InstructionBlock block, RemoveCompilerOptimizationsStep.SwitchData data) { V_0 = new Queue <InstructionBlock>(); V_1 = new HashSet <int>(); V_2 = block.get_Successors(); V_3 = 0; while (V_3 < (int)V_2.Length) { V_0.Enqueue(V_2[V_3]); V_3 = V_3 + 1; } while (V_0.get_Count() > 0) { V_5 = V_0.Dequeue(); dummyVar0 = V_1.Add(V_5.get_First().get_Offset()); if (!this.IsOptimizationBlock(this.blockExpressions.get_Item(V_5.get_First().get_Offset()), data.get_OptimizationVariable())) { if (!this.IsCaseBlock(this.blockExpressions.get_Item(V_5.get_First().get_Offset()), data.get_SwitchExpression()) && !this.IsNullCaseBlock(this.blockExpressions.get_Item(V_5.get_First().get_Offset()), data.get_SwitchExpression())) { continue; } this.switchBlocksToCasesMap.get_Item(block.get_First().get_Offset()).Add(V_5.get_First().get_Offset()); V_8 = V_5.get_Successors()[1]; if (this.IsEmptyStringCaseBlock(this.blockExpressions.get_Item(V_8.get_First().get_Offset()), data.get_SwitchExpression())) { V_5.set_Last(V_8.get_Last()); V_5.set_Successors(V_8.get_Successors()); V_9 = this.blockExpressions.get_Item(V_5.get_First().get_Offset()).get_Item(0) as BinaryExpression; V_9.set_Right(new LiteralExpression("", this.methodContext.get_Method().get_Module().get_TypeSystem(), null)); V_10 = this.blockExpressions.get_Item(V_8.get_First().get_Offset()).get_Item(0).get_UnderlyingSameMethodInstructions(); V_9 = V_9.CloneAndAttachInstructions(V_10) as BinaryExpression; this.blockExpressions.get_Item(V_5.get_First().get_Offset()).set_Item(0, new UnaryExpression(11, V_9, null)); this.blocksToBeRemoved.Add(V_8.get_First().get_Offset()); } dummyVar1 = this.MarkSecondSuccessorForRemovalIfItIsUnconditionalJump(V_5); } else { V_6 = V_5.get_Successors()[0]; if (!V_1.Contains(V_6.get_First().get_Offset())) { V_0.Enqueue(V_6); } V_7 = this.MarkSecondSuccessorForRemovalIfItIsUnconditionalJump(V_5); if (!V_1.Contains(V_7.get_First().get_Offset()) && this.IsOptimizationBlock(this.blockExpressions.get_Item(V_5.get_First().get_Offset()), data.get_OptimizationVariable())) { V_0.Enqueue(V_7); } this.blocksToBeRemoved.Add(V_5.get_First().get_Offset()); } } return; }
private void AddCasts() { V_0 = this.context.get_MethodContext().get_StackData().get_VariableToDefineUseInfo().GetEnumerator(); try { while (V_0.MoveNext()) { V_1 = V_0.get_Current(); V_2 = V_1.get_Value().get_UsedAt().GetEnumerator(); try { while (V_2.MoveNext()) { V_3 = V_2.get_Current(); if (!this.offsetToExpression.TryGetValue(V_3, out V_4)) { continue; } this.AddCastIfNeeded(V_4, V_1.get_Key()); } } finally { ((IDisposable)V_2).Dispose(); } V_5 = V_1.get_Value().get_DefinedAt().GetEnumerator(); try { while (V_5.MoveNext()) { V_6 = V_5.get_Current(); V_7 = this.offsetToExpression.get_Item(V_6); V_8 = this.GetInstructionBlock(V_6); V_9 = this.context.get_MethodContext().get_Expressions().get_BlockExpressions().get_Item(V_8.get_First().get_Offset()); this.FixAssignmentInList(V_9, V_7); } } finally { ((IDisposable)V_5).Dispose(); } } } finally { ((IDisposable)V_0).Dispose(); } return; }