Initial revision

This commit is contained in:
em
1985-02-06 21:25:27 +00:00
parent d7abe0e8b6
commit 0ff3a17f5e
78 changed files with 6131 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
.SILENT:
CEM=pdp
head: gen
diffs:
echo No diffs in ctprof
egen: tp.e
echo comparing tp.e
-if test -f tp.e.g ; then diff tp.cem.r tp.e.g ; else echo creating tp.e.g ; cp tp.cem.r tp.e.g ; fi
rm -f tp.e
tp.e: tp.c $(CEM)
$(CEM) -p -c.e tp.c
tp.cem.r: tp.cem
echo running tp
-tp.cem >tp.cem.r
rm -f tp.cem
procentry.k: procentry.c
$(CEM) -c.k procentry.c
tp.cem: tp.c procentry.k
echo $(CEM) tp.c procentry.k
$(CEM) -p -o tp.cem -O tp.c procentry.k
rm -f procentry.[kosm] tp.[kmos]
gen: tp.cem.r
echo comparing tp
-if test -f tp.cem.g ; then diff tp.cem.r tp.cem.g ; else echo creating tp.cem.g ; cp tp.cem.r tp.cem.g ; fi
pr:
@pr `pwd`/*.c tp.cem.g
opr:
make pr | opr
cleanup:
-rm -f *.[kosme] *.old
transI transM cmpI cmpM:

View File

@@ -0,0 +1,36 @@
/*
* (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
*
* This product is part of the Amsterdam Compiler Kit.
*
* Permission to use, sell, duplicate or disclose this software must be
* obtained in writing. Requests for such permissions may be sent to
*
* Dr. Andrew S. Tanenbaum
* Wiskundig Seminarium
* Vrije Universiteit
* Postbox 7161
* 1007 MC Amsterdam
* The Netherlands
*
*/
static int level = 0 ;
int procentry(name) char *name ; {
register int count ;
count=level++ ;
while ( count-- ) {
printf(" ") ;
}
printf("Entering %s\n",name) ;
}
int procexit(name) char *name ; {
register int count ;
count= --level ;
while ( count-- ) {
printf(" ") ;
}
printf("Leaving %s\n",name) ;
}

View File

@@ -0,0 +1,2 @@
echo test profiling
make -k "`grep CEM= ../makefile`" ${1-gen}

View File

@@ -0,0 +1,27 @@
/*
* (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
*
* This product is part of the Amsterdam Compiler Kit.
*
* Permission to use, sell, duplicate or disclose this software must be
* obtained in writing. Requests for such permissions may be sent to
*
* Dr. Andrew S. Tanenbaum
* Wiskundig Seminarium
* Vrije Universiteit
* Postbox 7161
* 1007 MC Amsterdam
* The Netherlands
*
*/
/* Author: E.G. Keizer */
int fac(n) { return ( n==0 ? 1 : n*fac(n-1)) ; }
main() {
{ int dummy ;
if ( fac(6) != 720 ) printf("vernielt return waarde\n") ;
}
return 0 ;
}

View File

@@ -0,0 +1,16 @@
Entering main
Entering fac
Entering fac
Entering fac
Entering fac
Entering fac
Entering fac
Entering fac
Leaving fac
Leaving fac
Leaving fac
Leaving fac
Leaving fac
Leaving fac
Leaving fac
Leaving main