dataflow.c 683 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. /* DATAFLOW ANALYSIS ON C PROGRAMS */
  7. /* Compile the C compiler with flag DATAFLOW.
  8. Use the compiler option --d.
  9. */
  10. #include "dataflow.h" /* UF */
  11. #ifdef DATAFLOW
  12. char *CurrentFunction = 0;
  13. int NumberOfCalls;
  14. DfaStartFunction(nm)
  15. char *nm;
  16. {
  17. CurrentFunction = nm;
  18. NumberOfCalls = 0;
  19. }
  20. DfaEndFunction()
  21. {
  22. if (NumberOfCalls == 0)
  23. print("DFA: %s: --none--\n", CurrentFunction);
  24. }
  25. DfaCallFunction(s)
  26. char *s;
  27. {
  28. print("DFA: %s: %s\n", CurrentFunction, s);
  29. ++NumberOfCalls;
  30. }
  31. #endif /* DATAFLOW */