瀏覽代碼

[analyzer] remove redundant SEEnd syntax edge kind

Dan Korostelev 8 年之前
父節點
當前提交
79cc31bb97
共有 3 個文件被更改,包括 3 次插入7 次删除
  1. 0 2
      src/optimization/analyzer.ml
  2. 2 3
      src/optimization/analyzerTexprTransformer.ml
  3. 1 2
      src/optimization/analyzerTypes.ml

+ 0 - 2
src/optimization/analyzer.ml

@@ -759,8 +759,6 @@ module Debug = struct
 			edge bb_try "try";
 			edge bb_try "try";
 			List.iter (fun (_,bb_catch) -> edge bb_catch "catch") bbl;
 			List.iter (fun (_,bb_catch) -> edge bb_catch "catch") bbl;
 			edge bb_next "next";
 			edge bb_next "next";
-		| SEEnd ->
-			()
 		| SENone ->
 		| SENone ->
 			()
 			()
 
 

+ 2 - 3
src/optimization/analyzerTexprTransformer.ml

@@ -665,8 +665,7 @@ let from_tfunction ctx tf t p =
 	let bb_func,bb_exit = func ctx g.g_root tf t p in
 	let bb_func,bb_exit = func ctx g.g_root tf t p in
 	ctx.entry <- bb_func;
 	ctx.entry <- bb_func;
 	close_node g g.g_root;
 	close_node g g.g_root;
-	g.g_exit <- bb_exit;
-	set_syntax_edge bb_exit SEEnd
+	g.g_exit <- bb_exit
 
 
 let rec block_to_texpr_el ctx bb =
 let rec block_to_texpr_el ctx bb =
 	if bb.bb_dominator == ctx.graph.g_unreachable then
 	if bb.bb_dominator == ctx.graph.g_unreachable then
@@ -680,7 +679,7 @@ let rec block_to_texpr_el ctx bb =
 				Some bb_next,(block bb_sub) :: el
 				Some bb_next,(block bb_sub) :: el
 			| el,SEMerge bb_next ->
 			| el,SEMerge bb_next ->
 				Some bb_next,el
 				Some bb_next,el
-			| el,(SEEnd | SENone) ->
+			| el,SENone ->
 				None,el
 				None,el
 			| {eexpr = TWhile(e1,_,flag)} as e :: el,(SEWhile(_,bb_body,bb_next)) ->
 			| {eexpr = TWhile(e1,_,flag)} as e :: el,(SEWhile(_,bb_body,bb_next)) ->
 				let e2 = block bb_body in
 				let e2 = block bb_body in

+ 1 - 2
src/optimization/analyzerTypes.ml

@@ -70,7 +70,6 @@ module BasicBlock = struct
 		| SEWhile of t * t * t                                   (* `while` with "head", "body" and "next" *)
 		| SEWhile of t * t * t                                   (* `while` with "head", "body" and "next" *)
 		| SESubBlock of t * t                                    (* "sub" with "next" *)
 		| SESubBlock of t * t                                    (* "sub" with "next" *)
 		| SEMerge of t                                           (* Merge to same block *)
 		| SEMerge of t                                           (* Merge to same block *)
-		| SEEnd                                                  (* End of syntax *)
 		| SENone                                                 (* No syntax exit *)
 		| SENone                                                 (* No syntax exit *)
 
 
 	and t = {
 	and t = {
@@ -506,7 +505,7 @@ module Graph = struct
 					loop scopes bb_next
 					loop scopes bb_next
 				| SEMerge bb ->
 				| SEMerge bb ->
 					loop scopes bb
 					loop scopes bb
-				| SEEnd | SENone ->
+				| SENone ->
 					()
 					()
 			end
 			end
 		in
 		in