GCC Middle and Back End API Reference
coverage.h
Go to the documentation of this file.
1/* coverage.h - Defines data exported from coverage.cc
2 Copyright (C) 1998-2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_COVERAGE_H
21#define GCC_COVERAGE_H
22
23#include "gcov-io.h"
24
25extern void coverage_init (const char *);
26extern void coverage_finish (void);
27extern void coverage_init_file (void);
28extern void coverage_finish_file (void);
29extern void coverage_remove_note_file (void);
30
31/* Start outputting coverage information for the current
32 function. */
33extern int coverage_begin_function (unsigned, unsigned);
34
35/* Complete the coverage information for the current function. */
36extern void coverage_end_function (unsigned, unsigned);
37
38/* Compute the control flow checksum for the function FN given as argument. */
39extern unsigned coverage_compute_cfg_checksum (struct function *fn);
40
41/* Compute the profile id of function N. */
42extern unsigned coverage_compute_profile_id (struct cgraph_node *n);
43
44/* Compute the line number checksum for the current function. */
45extern unsigned coverage_compute_lineno_checksum (void);
46
47/* Allocate some counters. Repeatable per function. */
48extern int coverage_counter_alloc (unsigned /*counter*/, unsigned/*num*/);
49/* Use a counter from the most recent allocation. */
50extern tree tree_coverage_counter_ref (unsigned /*counter*/, unsigned/*num*/);
51/* Use a counter address from the most recent allocation. */
52extern tree tree_coverage_counter_addr (unsigned /*counter*/, unsigned/*num*/);
53
54/* Get all the counters for the current function. */
55extern gcov_type *get_coverage_counts (unsigned /*counter*/,
56 unsigned /*cfg_checksum*/,
57 unsigned /*lineno_checksum*/,
58 unsigned /*n_counts*/);
59
60extern tree get_gcov_type (void);
61extern bool coverage_node_map_initialized_p (void);
62
63#endif
int64_t gcov_type
Definition coretypes.h:46
union tree_node * tree
Definition coretypes.h:97
void coverage_remove_note_file(void)
Definition coverage.cc:744
tree tree_coverage_counter_ref(unsigned, unsigned)
Definition coverage.cc:442
int coverage_counter_alloc(unsigned, unsigned)
Definition coverage.cc:416
tree tree_coverage_counter_addr(unsigned, unsigned)
Definition coverage.cc:458
int coverage_begin_function(unsigned, unsigned)
Definition coverage.cc:624
void coverage_init(const char *)
Definition coverage.cc:1282
void coverage_end_function(unsigned, unsigned)
Definition coverage.cc:684
void coverage_init_file(void)
Definition coverage.cc:1254
void coverage_finish(void)
Definition coverage.cc:1384
unsigned coverage_compute_cfg_checksum(struct function *fn)
Definition coverage.cc:601
unsigned coverage_compute_lineno_checksum(void)
Definition coverage.cc:536
bool coverage_node_map_initialized_p(void)
Definition value-prof.cc:1219
gcov_type * get_coverage_counts(unsigned, unsigned, unsigned, unsigned)
tree get_gcov_type(void)
Definition coverage.cc:138
unsigned coverage_compute_profile_id(struct cgraph_node *n)
Definition coverage.cc:553
void coverage_finish_file(void)
Definition coverage.cc:1368
Definition cgraph.h:920
Definition function.h:249