GCC Middle and Back End API Reference
coverage.h File Reference

Go to the source code of this file.

Functions

void coverage_init (const char *)
void coverage_finish (void)
int coverage_begin_function (unsigned, unsigned)
void coverage_end_function (unsigned, unsigned)
unsigned coverage_compute_cfg_checksum (void)
unsigned coverage_compute_profile_id (struct cgraph_node *n)
unsigned coverage_compute_lineno_checksum (void)
int coverage_counter_alloc (unsigned, unsigned)
tree tree_coverage_counter_ref (unsigned, unsigned)
tree tree_coverage_counter_addr (unsigned, unsigned)
gcov_typeget_coverage_counts (unsigned, unsigned, unsigned, unsigned, const struct gcov_ctr_summary **)
tree get_gcov_type (void)

Function Documentation

int coverage_begin_function ( unsigned  ,
unsigned   
)
Start outputting coverage information for the current
   function.   
unsigned coverage_compute_cfg_checksum ( void  )
Compute the control flow checksum for the current function.   
Compute cfg checksum for the current function.
   The checksum is calculated carefully so that
   source code changes that doesn't affect the control flow graph
   won't change the checksum.
   This is to make the profile data useable across source code change.
   The downside of this is that the compiler may use potentially
   wrong profile data - that the source code change has non-trivial impact
   on the validity of profile data (e.g. the reversed condition)
   but the compiler won't detect the change and use the wrong profile data.   

References crc32_byte(), edge_def::dest, basic_block_def::index, and basic_block_def::succs.

Referenced by branch_prob().

unsigned coverage_compute_lineno_checksum ( void  )
Compute the line number checksum for the current function.   
Compute checksum for the current function.  We generate a CRC32.   

References coverage_checksum_string(), current_function_decl, and expand_location().

Referenced by branch_prob().

unsigned coverage_compute_profile_id ( struct cgraph_node n)
Compute the profile id of function N.   
int coverage_counter_alloc ( unsigned  ,
unsigned   
)
Allocate some counters. Repeatable per function.   
void coverage_end_function ( unsigned  ,
unsigned   
)
Complete the coverage information for the current function.   
void coverage_finish ( void  )
Performs file-level cleanup.  Close notes file, generate coverage
   variables and constructor.   

References bbg_file_name, coverage_obj_finish(), coverage_obj_fn(), coverage_obj_init(), da_file_name, coverage_data::fn_decl, functions_head, gcov_close(), local_tick, and coverage_data::next.

Referenced by ipa_passes().

void coverage_init ( const char *  )
gcov_type* get_coverage_counts ( unsigned  counter,
unsigned  expected,
unsigned  cfg_checksum,
unsigned  lineno_checksum,
const struct gcov_ctr_summary **  summary 
)
tree tree_coverage_counter_addr ( unsigned  ,
unsigned   
)
Use a counter address from the most recent allocation.   
tree tree_coverage_counter_ref ( unsigned  ,
unsigned   
)
Use a counter from the most recent allocation.