dataflow.c 524 B

12345678910111213141516171819202122232425262728293031323334
  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. printf("DFA: %s: --none--\n", CurrentFunction);
  20. }
  21. }
  22. DfaCallFunction(s)
  23. char *s;
  24. {
  25. printf("DFA: %s: %s\n", CurrentFunction, s);
  26. ++NumberOfCalls;
  27. }
  28. #endif DATAFLOW