cg_arcs.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Copyright (C) 2012-2015 Free Software Foundation, Inc.
  2. This file is part of GNU Binutils.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  14. MA 02110-1301, USA. */
  15. #ifndef cg_arcs_h
  16. #define cg_arcs_h
  17. /*
  18. * Arc structure for call-graph.
  19. *
  20. * With pointers to the symbols of the parent and the child, a count
  21. * of how many times this arc was traversed, and pointers to the next
  22. * parent of this child and the next child of this parent.
  23. */
  24. typedef struct arc
  25. {
  26. Sym *parent; /* source vertice of arc */
  27. Sym *child; /* dest vertice of arc */
  28. unsigned long count; /* # of calls from parent to child */
  29. double time; /* time inherited along arc */
  30. double child_time; /* child-time inherited along arc */
  31. struct arc *next_parent; /* next parent of CHILD */
  32. struct arc *next_child; /* next child of PARENT */
  33. int has_been_placed; /* have this arc's functions been placed? */
  34. }
  35. Arc;
  36. extern unsigned int num_cycles; /* number of cycles discovered */
  37. extern Sym *cycle_header; /* cycle headers */
  38. extern void arc_add (Sym * parent, Sym * child, unsigned long count);
  39. extern Arc *arc_lookup (Sym * parent, Sym * child);
  40. extern Sym **cg_assemble (void);
  41. extern Arc **arcs;
  42. extern unsigned int numarcs;
  43. #endif /* cg_arcs_h */