From 3b4dda102b69d8db8e5f039f001c2687052647f4 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Mon, 9 Nov 2015 07:36:41 -0800 Subject: [PATCH] Change return type of CTrans.loop_instruction Summary: public make loop_instruction return res_trans. Reviewed By: dulmarod Differential Revision: D2631560 fb-gh-sync-id: 8565d1b --- infer/src/clang/cTrans.ml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index d9a1dba6f..94db4e141 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -1296,22 +1296,19 @@ struct | Loops.For _ -> (match init_incr_nodes with | Some (nodes_init, nodes_incr) -> nodes_init | None -> assert false) | Loops.While _ | Loops.DoWhile _ -> [join_node] in - root_nodes, prune_nodes_f + { empty_res_trans with root_nodes = root_nodes; leaf_nodes = prune_nodes_f } and forStmt_trans trans_state init cond incr body stmt_info = let for_kind = Loops.For (init, cond, incr, body) in - let root_nodes, leaf_nodes = loop_instruction trans_state for_kind stmt_info in - { empty_res_trans with root_nodes = root_nodes; leaf_nodes = leaf_nodes } + loop_instruction trans_state for_kind stmt_info and whileStmt_trans trans_state cond body stmt_info = let while_kind = Loops.While (cond, body) in - let root_nodes, leaf_nodes = loop_instruction trans_state while_kind stmt_info in - { empty_res_trans with root_nodes = root_nodes; leaf_nodes = leaf_nodes } + loop_instruction trans_state while_kind stmt_info and doStmt_trans trans_state stmt_info cond body = let dowhile_kind = Loops.DoWhile (cond, body) in - let root_nodes, leaf_nodes = loop_instruction trans_state dowhile_kind stmt_info in - { empty_res_trans with root_nodes = root_nodes; leaf_nodes = leaf_nodes } + loop_instruction trans_state dowhile_kind stmt_info and objCForCollectionStmt_trans trans_state item items body stmt_info = let _ = instruction trans_state item in @@ -1319,8 +1316,7 @@ struct (* variable item but we still need to add the variable to the locals *) let bin_op = Ast_expressions.make_next_object_exp stmt_info item items in let while_kind = Loops.While (bin_op, body) in - let root_nodes, leaf_nodes = loop_instruction trans_state while_kind stmt_info in - { empty_res_trans with root_nodes = root_nodes; leaf_nodes = leaf_nodes } + loop_instruction trans_state while_kind stmt_info (* Assumption: We expect precisely 2 stmt corresponding to the 2 operands. *) and compoundAssignOperator trans_state stmt_info binary_operator_info expr_info stmt_list =