diff options
Diffstat (limited to 'gcc/tree-profile.c')
-rw-r--r-- | gcc/tree-profile.c | 48 |
1 files changed, 17 insertions, 31 deletions
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c index bd7556a074a..b8e54d468e2 100644 --- a/gcc/tree-profile.c +++ b/gcc/tree-profile.c @@ -203,7 +203,7 @@ tree_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base) tree stmt = value->hvalue.stmt; block_stmt_iterator bsi = bsi_for_stmt (stmt); tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; - tree args, call, val; + tree call, val; tree start = build_int_cst_type (integer_type_node, value->hdata.intvl.int_start); tree steps = build_int_cst_type (unsigned_type_node, value->hdata.intvl.steps); @@ -211,12 +211,8 @@ tree_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base) build_addr (ref, current_function_decl), true, NULL_TREE); val = prepare_instrumented_value (&bsi, value); - args = tree_cons (NULL_TREE, ref_ptr, - tree_cons (NULL_TREE, val, - tree_cons (NULL_TREE, start, - tree_cons (NULL_TREE, steps, - NULL_TREE)))); - call = build_function_call_expr (tree_interval_profiler_fn, args); + call = build_call_expr (tree_interval_profiler_fn, 4, + ref_ptr, val, start, steps); bsi_insert_before (&bsi, call, BSI_SAME_STMT); } @@ -230,16 +226,13 @@ tree_gen_pow2_profiler (histogram_value value, unsigned tag, unsigned base) tree stmt = value->hvalue.stmt; block_stmt_iterator bsi = bsi_for_stmt (stmt); tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; - tree args, call, val; + tree call, val; ref_ptr = force_gimple_operand_bsi (&bsi, build_addr (ref, current_function_decl), true, NULL_TREE); val = prepare_instrumented_value (&bsi, value); - args = tree_cons (NULL_TREE, ref_ptr, - tree_cons (NULL_TREE, val, - NULL_TREE)); - call = build_function_call_expr (tree_pow2_profiler_fn, args); + call = build_call_expr (tree_pow2_profiler_fn, 2, ref_ptr, val); bsi_insert_before (&bsi, call, BSI_SAME_STMT); } @@ -253,16 +246,13 @@ tree_gen_one_value_profiler (histogram_value value, unsigned tag, unsigned base) tree stmt = value->hvalue.stmt; block_stmt_iterator bsi = bsi_for_stmt (stmt); tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; - tree args, call, val; + tree call, val; ref_ptr = force_gimple_operand_bsi (&bsi, build_addr (ref, current_function_decl), true, NULL_TREE); val = prepare_instrumented_value (&bsi, value); - args = tree_cons (NULL_TREE, ref_ptr, - tree_cons (NULL_TREE, val, - NULL_TREE)); - call = build_function_call_expr (tree_one_value_profiler_fn, args); + call = build_call_expr (tree_one_value_profiler_fn, 2, ref_ptr, val); bsi_insert_before (&bsi, call, BSI_SAME_STMT); } @@ -320,7 +310,7 @@ tree_gen_ic_func_profiler (void) basic_block bb; edge_iterator ei; tree stmt1; - tree args, tree_uid, cur_func; + tree tree_uid, cur_func; if (flag_unit_at_a_time) { @@ -339,13 +329,11 @@ tree_gen_ic_func_profiler (void) current_function_decl), true, NULL_TREE); tree_uid = build_int_cst (gcov_type_node, c_node->pid); - args = tree_cons (NULL_TREE, ic_gcov_type_ptr_var, - tree_cons (NULL_TREE, tree_uid, - tree_cons (NULL_TREE, cur_func, - tree_cons (NULL_TREE, - ic_void_ptr_var, - NULL_TREE)))); - stmt1 = build_function_call_expr (tree_indirect_call_profiler_fn, args); + stmt1 = build_call_expr (tree_indirect_call_profiler_fn, 4, + ic_gcov_type_ptr_var, + tree_uid, + cur_func, + ic_void_ptr_var); bsi_insert_after (&bsi, stmt1, BSI_SAME_STMT); } } @@ -377,14 +365,13 @@ tree_gen_average_profiler (histogram_value value, unsigned tag, unsigned base) tree stmt = value->hvalue.stmt; block_stmt_iterator bsi = bsi_for_stmt (stmt); tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; - tree args, call, val; + tree call, val; ref_ptr = force_gimple_operand_bsi (&bsi, build_addr (ref, current_function_decl), true, NULL_TREE); val = prepare_instrumented_value (&bsi, value); - args = tree_cons (NULL_TREE, ref_ptr, tree_cons (NULL_TREE, val, NULL_TREE)); - call = build_function_call_expr (tree_average_profiler_fn, args); + call = build_call_expr (tree_average_profiler_fn, 2, ref_ptr, val); bsi_insert_before (&bsi, call, BSI_SAME_STMT); } @@ -398,14 +385,13 @@ tree_gen_ior_profiler (histogram_value value, unsigned tag, unsigned base) tree stmt = value->hvalue.stmt; block_stmt_iterator bsi = bsi_for_stmt (stmt); tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; - tree args, call, val; + tree call, val; ref_ptr = force_gimple_operand_bsi (&bsi, build_addr (ref, current_function_decl), true, NULL_TREE); val = prepare_instrumented_value (&bsi, value); - args = tree_cons (NULL_TREE, ref_ptr, tree_cons (NULL_TREE, val, NULL_TREE)); - call = build_function_call_expr (tree_ior_profiler_fn, args); + call = build_call_expr (tree_ior_profiler_fn, 2, ref_ptr, val); bsi_insert_before (&bsi, call, BSI_SAME_STMT); } |