dataflow.c 517 B

123456789101112131415161718192021222324252627282930313233
  1. /* $Header$ */
  2. /* DATAFLOW ANALYSIS ON C PROGRAMS */
  3. /* Compile the C compiler with flag DATAFLOW.
  4. Use the compiler option --d.
  5. */
  6. #include "dataflow.h" /* UF */
  7. #ifdef DATAFLOW
  8. char *CurrentFunction = 0;
  9. int NumberOfCalls;
  10. DfaStartFunction(nm)
  11. char *nm;
  12. {
  13. CurrentFunction = nm;
  14. NumberOfCalls = 0;
  15. }
  16. DfaEndFunction()
  17. {
  18. if (NumberOfCalls == 0)
  19. print("DFA: %s: --none--\n", CurrentFunction);
  20. }
  21. DfaCallFunction(s)
  22. char *s;
  23. {
  24. print("DFA: %s: %s\n", CurrentFunction, s);
  25. ++NumberOfCalls;
  26. }
  27. #endif DATAFLOW