BSD 4_1_snap development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Wed, 30 Apr 1980 06:59:28 +0000 (22:59 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Wed, 30 Apr 1980 06:59:28 +0000 (22:59 -0800)
Work on file usr/src/cmd/mip/convert
Work on file usr/src/cmd/mip/fconvert
Work on file usr/src/cmd/mip/ftable.c
Work on file usr/src/cmd/mip/freader.c

Synthesized-from: CSRG/cd1/4.1.snap

usr/src/cmd/mip/convert [new file with mode: 0644]
usr/src/cmd/mip/fconvert [new file with mode: 0644]
usr/src/cmd/mip/freader.c [new file with mode: 0644]
usr/src/cmd/mip/ftable.c [new file with mode: 0644]

diff --git a/usr/src/cmd/mip/convert b/usr/src/cmd/mip/convert
new file mode 100644 (file)
index 0000000..179bea1
--- /dev/null
@@ -0,0 +1,83 @@
+To convert two pass to 1 pass operation:
+(I suggest that you use a subdirectory, since
+it is hard to repair some of this damage once done)
+
+I assume that you have new copies of the machine-independent
+files.  The file cl is no longer used, and there is no
+use of lex at all.  The file scan.c contains the new
+lexical analyzer.  Moreover, the file comm2.c is no longer
+used when the passes are loaded together.
+These changes may affect local procedures for searching, printing,
+diffing, etc. the compiler.
+
+I suggest that you take the makefile in /usr/n as well, to help you
+along.
+
+The conversion process, as well as I understand it is as follows.
+
+1.  Make a subdirectory, and put in it the old machine dependent files
+macdefs, mac2defs, local.c, order.c, code.c, local2.c, and table.c.
+Put in all the new machine independent stuff, including the new makefile
+
+2.  Insert the line # define ONEPASS into macdefs
+Change LABFMT by deleting the \n.
+
+3.  In all the machine dependent source files local.c,
+code.c, order.c, local2.c, and table.c, remove the includes of
+manifest and macdefs; these are now included by mfile1 and mfile2.
+
+4.  The main routine for pass 2 (probably on local2.c)
+should be deleted; it probably only does a call to mainp2.
+If it does anything else of interest,
+let me know.
+
+5.  On the file local.c, in the routine `ecode',
+replace the lines
+     printf( ".%d\t%s\n", lineno, ftitle );
+     prtree( p );
+by
+     p2tree( p );
+     p2compile( p );
+
+6.  In code.c, in the function bccode, replace the line
+     printf( "[\t%d\t%d\t%d\t\n", ftnno, XXXX, YYYY );
+by
+     p2bbeg( XXXX, YYYY );
+Also, in efcode, replace the line which prints out the "]..."
+with
+     p2bend();
+
+7.  In code.c and local.c, look at all remaining printfs.  Lines
+which go onto the intermediate file all had ")" at the head.
+All of these must be clobbered.  Thus, a line which read
+     printf( ")    xxx yyy\n)   zzz  www\n" );
+must be changed to read
+     printf( "    xxx yyy\n   zzz  www\n" );
+This is tedious, although a few cleverly chosen ed commands
+will probably do the trick.
+
+8.  Say make, and stand back.  The result is a
+single program called comp.
+You may experience loading errors as a result of having used the
+same external names in the first and second pass.  Look at the
+beginning of mfile2 to get a hint about one way to deal with
+this problem (add stuff to mac2defs to change the names).
+The other way to deal with it is just fix it...
+
+9.  As a side-effect of other changes, the meaning of the arguments
+to match has changed slightly; ASG OPANY, as it always
+did, matches any assignment op except ++, --, and = itself.
+OPANY, on the other hand, matches only ops which are not assignment
+ops.  In table.c, there must be explicit rewriting rule entries for
+++, --, and =.  In most cases with which I am familiar, this should
+be true already, and no change is needed.
+
+10. Usage is  /lib/cpp x.c | comp
+which produces assembler output on the std. output.
+research!/usr/bin/ncc gives the interdata compiler, with many
+bells and whistles, as a Bourne shell script.
+regression tests, and checks that this compiler
+produces the same output as the earlier one, are
+both wise.
+
+Good Luck!
diff --git a/usr/src/cmd/mip/fconvert b/usr/src/cmd/mip/fconvert
new file mode 100644 (file)
index 0000000..6a0a02b
--- /dev/null
@@ -0,0 +1,27 @@
+In an attempt to speed up the Fortran 77
+compiler, we have provided a new interface between
+the fortran compiler and the portable C compiler.
+The intermediate file is binary, and the result is
+to speed up the execution of Fortran considerably.
+The changes necessary to make this work are as follows:
+
+***    The ONEPASS flag should be off for Fortran;
+       the simplest way of making this happen is to take
+       the line # define ONEPASS on macdefs, and put a
+       # ifndef FORT ... # endif around it.
+
+***    The function label from pass 1 must be put in
+       a file, fort.h.  Also,  a simple function, tlabel,
+       must be written to copy names and make labels.
+
+***    The function `where' must be defined, as well as the
+       function main (which was once on local2.c).
+       They can be defined on fort.h, or on local2.c
+       (surrounded by # ifnded ONEPASS and # endif)
+
+***    Other things from pass one may have crept into the pass 2
+       code: they must be also done, either on fort.h or
+       on local2.c surrounded by ifdefs.
+
+***    make fort  then creates the fortran interface...
+
diff --git a/usr/src/cmd/mip/freader.c b/usr/src/cmd/mip/freader.c
new file mode 100644 (file)
index 0000000..205b14b
--- /dev/null
@@ -0,0 +1,3 @@
+# define FORT
+# define NOMAIN
+# include "reader.c"
diff --git a/usr/src/cmd/mip/ftable.c b/usr/src/cmd/mip/ftable.c
new file mode 100644 (file)
index 0000000..95809a5
--- /dev/null
@@ -0,0 +1,2 @@
+# define FORT
+# include "table.c"