coverage.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* coverage.h - Defines data exported from coverage.c
  2. Copyright (C) 1998-2019 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef GCC_COVERAGE_H
  16. #define GCC_COVERAGE_H
  17. #include "gcov-io.h"
  18. extern void coverage_init (const char *);
  19. extern void coverage_finish (void);
  20. extern void coverage_remove_note_file (void);
  21. /* Start outputting coverage information for the current
  22. function. */
  23. extern int coverage_begin_function (unsigned, unsigned);
  24. /* Complete the coverage information for the current function. */
  25. extern void coverage_end_function (unsigned, unsigned);
  26. /* Compute the control flow checksum for the function FN given as argument. */
  27. extern unsigned coverage_compute_cfg_checksum (struct function *fn);
  28. /* Compute the profile id of function N. */
  29. extern unsigned coverage_compute_profile_id (struct cgraph_node *n);
  30. /* Compute the line number checksum for the current function. */
  31. extern unsigned coverage_compute_lineno_checksum (void);
  32. /* Allocate some counters. Repeatable per function. */
  33. extern int coverage_counter_alloc (unsigned /*counter*/, unsigned/*num*/);
  34. /* Use a counter from the most recent allocation. */
  35. extern tree tree_coverage_counter_ref (unsigned /*counter*/, unsigned/*num*/);
  36. /* Use a counter address from the most recent allocation. */
  37. extern tree tree_coverage_counter_addr (unsigned /*counter*/, unsigned/*num*/);
  38. /* Get all the counters for the current function. */
  39. extern gcov_type *get_coverage_counts (unsigned /*counter*/,
  40. unsigned /*cfg_checksum*/,
  41. unsigned /*lineno_checksum*/,
  42. unsigned /*n_counts*/);
  43. extern tree get_gcov_type (void);
  44. extern bool coverage_node_map_initialized_p (void);
  45. #endif