GCC Middle and Back End API Reference
coverage.h File Reference
#include "gcov-io.h"
Include dependency graph for coverage.h:
This graph shows which files directly or indirectly include this file:

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.

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.

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.

Only remove the da file, if we're emitting coverage code and cannot uniquely stamp it. If we can stamp it, libgcov will DTRT.

void coverage_init ( const char *  )

coverage.h - Defines data exported from coverage.c Copyright (C) 1998-2013 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.

gcov_type* get_coverage_counts ( unsigned  counter,
unsigned  expected,
unsigned  cfg_checksum,
unsigned  lineno_checksum,
const struct gcov_ctr_summary **  summary 
)

Get all the counters for the current function.

Returns the counters for a particular tag.

No hash table, no counts.

   The function was not emitted, or is weak and not chosen in the
   final executable.  Silently fail, because there's nothing we
   can do about it.   
tree get_gcov_type ( void  )

Return the type node for gcov_type.

Referenced by coverage_counter_alloc(), coverage_end_function(), and gimple_init_edge_profiler().

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.