This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto] PATCH: CALL_EXPR changes to gcc/tree-profile.c


Already committed as "obvious".

-Sandra
2006-07-12  Sandra Loosemore  <sandra@codesourcery.com>

	* gcc/tree-profile.c (tree_gen_interval_profiler): Use
	build_call_expr.
	(tree_gen_pow2_profiler): Likewise.
	(tree_gen_one_value_profiler): Likewise.

Index: gcc/tree-profile.c
===================================================================
*** gcc/tree-profile.c	(revision 115346)
--- gcc/tree-profile.c	(working copy)
*************** tree_gen_interval_profiler (histogram_va
*** 138,144 ****
    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 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);
    
--- 138,144 ----
    tree stmt = value->hvalue.stmt;
    block_stmt_iterator bsi = bsi_for_stmt (stmt);
    tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
!   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);
    
*************** tree_gen_interval_profiler (histogram_va
*** 146,157 ****
  				      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);
    bsi_insert_before (&bsi, call, BSI_SAME_STMT);
  }
  
--- 146,153 ----
  				      build_addr (ref, current_function_decl),
  				      true, NULL_TREE);
    val = prepare_instrumented_value (&bsi, value);
!   call = build_call_expr (tree_interval_profiler_fn, 4,
! 			  ref_ptr, val, start, steps);
    bsi_insert_before (&bsi, call, BSI_SAME_STMT);
  }
  
*************** tree_gen_pow2_profiler (histogram_value 
*** 165,180 ****
    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;
    
    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);
    bsi_insert_before (&bsi, call, BSI_SAME_STMT);
  }
  
--- 161,173 ----
    tree stmt = value->hvalue.stmt;
    block_stmt_iterator bsi = bsi_for_stmt (stmt);
    tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
!   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);
!   call = build_call_expr (tree_pow2_profiler_fn, 2, ref_ptr, val);
    bsi_insert_before (&bsi, call, BSI_SAME_STMT);
  }
  
*************** tree_gen_one_value_profiler (histogram_v
*** 188,203 ****
    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;
    
    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);
    bsi_insert_before (&bsi, call, BSI_SAME_STMT);
  }
  
--- 181,193 ----
    tree stmt = value->hvalue.stmt;
    block_stmt_iterator bsi = bsi_for_stmt (stmt);
    tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
!   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);
!   call = build_call_expr (tree_one_value_profiler_fn, 2, ref_ptr, val);
    bsi_insert_before (&bsi, call, BSI_SAME_STMT);
  }
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]