coverage.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* coverage.h - Defines data exported from coverage.c
  2. Copyright (C) 1998-2015 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. /* Start outputting coverage information for the current
  21. function. */
  22. extern int coverage_begin_function (unsigned, unsigned);
  23. /* Complete the coverage information for the current function. */
  24. extern void coverage_end_function (unsigned, unsigned);
  25. /* Compute the control flow checksum for the function FN given as argument. */
  26. extern unsigned coverage_compute_cfg_checksum (struct function *fn);
  27. /* Compute the profile id of function N. */
  28. extern unsigned coverage_compute_profile_id (struct cgraph_node *n);
  29. /* Compute the line number checksum for the current function. */
  30. extern unsigned coverage_compute_lineno_checksum (void);
  31. /* Allocate some counters. Repeatable per function. */
  32. extern int coverage_counter_alloc (unsigned /*counter*/, unsigned/*num*/);
  33. /* Use a counter from the most recent allocation. */
  34. extern tree tree_coverage_counter_ref (unsigned /*counter*/, unsigned/*num*/);
  35. /* Use a counter address from the most recent allocation. */
  36. extern tree tree_coverage_counter_addr (unsigned /*counter*/, unsigned/*num*/);
  37. /* Get all the counters for the current function. */
  38. extern gcov_type *get_coverage_counts (unsigned /*counter*/,
  39. unsigned /*expected*/,
  40. unsigned /*cfg_checksum*/,
  41. unsigned /*lineno_checksum*/,
  42. const struct gcov_ctr_summary **);
  43. extern tree get_gcov_type (void);
  44. extern bool coverage_node_map_initialized_p (void);
  45. #endif