public static KeyValuePair <CFGBlockLogicalConstruct, CFGBlockLogicalConstruct> SplitCFGBlockAt(LogicalFlowBuilderContext logicalContext, CFGBlockLogicalConstruct cfgBlock, int expressionIndex) { V_0 = cfgBlock.get_LogicalConstructExpressions(); if (V_0 == null) { throw new ArgumentNullException("blockExpressions"); } if (expressionIndex <= 0 || expressionIndex >= V_0.get_Count()) { throw new ArgumentOutOfRangeException("expressionIndex"); } V_1 = logicalContext.get_CFGBlockToLogicalConstructMap().get_Item(cfgBlock.get_TheBlock()); V_2 = (int)V_1.Length; V_3 = 0; while (V_3 < V_2 && cfgBlock != V_1[V_3]) { V_3 = V_3 + 1; } if (V_3 == V_2) { throw new ArgumentException("cfgBlock"); } V_4 = cfgBlock.get_LogicalConstructExpressions().GetRange(0, expressionIndex); V_5 = new PartialCFGBlockLogicalConstruct(cfgBlock, V_4); V_5.RedirectPredecessors(); V_6 = cfgBlock.get_LogicalConstructExpressions().GetRange(expressionIndex, V_0.get_Count() - expressionIndex); V_7 = new PartialCFGBlockLogicalConstruct(cfgBlock, V_6); V_7.RedirectSuccessors(); V_5.AddToSuccessors(V_7); V_7.AddToPredecessors(V_5); V_8 = new CFGBlockLogicalConstruct[V_2 + 1]; V_9 = 0; V_10 = 0; while (V_9 < V_2) { if (V_9 == V_3) { V_8[V_10] = V_5; stackVariable68 = V_10 + 1; V_10 = stackVariable68; V_8[stackVariable68] = V_7; } else { V_8[V_10] = V_1[V_9]; } V_9 = V_9 + 1; V_10 = V_10 + 1; } logicalContext.get_CFGBlockToLogicalConstructMap().set_Item(cfgBlock.get_TheBlock(), V_8); return(new KeyValuePair <CFGBlockLogicalConstruct, CFGBlockLogicalConstruct>(V_5, V_7)); }
protected string NodeILOffset(LogicalFlowBuilderContext context, CFGBlockLogicalConstruct node) { if (node == null) { return("null"); } V_0 = node as PartialCFGBlockLogicalConstruct; if (V_0 == null) { V_2 = node.get_TheBlock().get_First().get_Offset(); return(String.Format("IL_{0}", V_2.ToString("x4"))); } V_1 = Array.IndexOf <CFGBlockLogicalConstruct>(context.get_CFGBlockToLogicalConstructMap().get_Item(V_0.get_TheBlock()), V_0); if (V_1 == -1) { throw new Exception("Invalid partial block data."); } V_2 = V_0.get_TheBlock().get_First().get_Offset(); return(String.Format("IL_{0}_{1}", V_2.ToString("x4"), V_1)); }