1989-02-07 11:04:05 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1994-06-27 08:03:14 +00:00
|
|
|
/* $Id$ */
|
1989-02-07 11:04:05 +00:00
|
|
|
/* DATAFLOW ANALYSIS ON C PROGRAMS */
|
|
|
|
|
|
|
|
/* Compile the C compiler with flag DATAFLOW.
|
|
|
|
Use the compiler option --d.
|
|
|
|
*/
|
|
|
|
|
2013-05-12 19:45:55 +00:00
|
|
|
#include "parameters.h" /* UF */
|
2019-02-18 16:42:15 +00:00
|
|
|
#include "dataflow.h"
|
|
|
|
#include "print.h"
|
1989-02-07 11:04:05 +00:00
|
|
|
|
|
|
|
#ifdef DATAFLOW
|
|
|
|
char *CurrentFunction = 0;
|
|
|
|
int NumberOfCalls;
|
|
|
|
|
2019-02-18 16:42:15 +00:00
|
|
|
void DfaStartFunction(char* nm)
|
1989-02-07 11:04:05 +00:00
|
|
|
{
|
|
|
|
CurrentFunction = nm;
|
|
|
|
NumberOfCalls = 0;
|
|
|
|
}
|
|
|
|
|
2019-02-18 16:42:15 +00:00
|
|
|
void DfaEndFunction(void)
|
1989-02-07 11:04:05 +00:00
|
|
|
{
|
|
|
|
if (NumberOfCalls == 0)
|
|
|
|
print("DFA: %s: --none--\n", CurrentFunction);
|
|
|
|
}
|
|
|
|
|
2019-02-18 16:42:15 +00:00
|
|
|
void DfaCallFunction(char* s)
|
1989-02-07 11:04:05 +00:00
|
|
|
{
|
|
|
|
print("DFA: %s: %s\n", CurrentFunction, s);
|
|
|
|
++NumberOfCalls;
|
|
|
|
}
|
1991-12-17 13:12:22 +00:00
|
|
|
#endif /* DATAFLOW */
|