Пример #1
0
void
gimple_gen_ior_profiler (histogram_value value, unsigned tag, unsigned base)
{
  gimple stmt = value->hvalue.stmt;
  gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
  tree ref_ptr = tree_coverage_counter_addr (tag, base);
  gcall *call;
  tree val;

  ref_ptr = force_gimple_operand_gsi (&gsi, ref_ptr,
				      true, NULL_TREE, true, GSI_SAME_STMT);
  val = prepare_instrumented_value (&gsi, value);
  call = gimple_build_call (tree_ior_profiler_fn, 2, ref_ptr, val);
  gsi_insert_before (&gsi, call, GSI_NEW_STMT);
}
Пример #2
0
static void
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;

    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);
}
Пример #3
0
void
gimple_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base)
{
  gimple stmt = value->hvalue.stmt;
  gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
  tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
  gcall *call;
  tree 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);

  ref_ptr = force_gimple_operand_gsi (&gsi,
				      build_addr (ref, current_function_decl),
				      true, NULL_TREE, true, GSI_SAME_STMT);
  val = prepare_instrumented_value (&gsi, value);
  call = gimple_build_call (tree_interval_profiler_fn, 4,
			    ref_ptr, val, start, steps);
  gsi_insert_before (&gsi, call, GSI_NEW_STMT);
}