Google
 

Trailing-Edge - PDP-10 Archives - BB-4157E-BM - fortran-compiler/ph2s.bli
There are 12 other files named ph2s.bli in the archive. Click here to see a list.
!THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
!  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.

!COPYRIGHT (C) 1972,1981 BY DIGITAL EQUIPMENT CORPORATION
!AUTHOR: S MURPHY/EGM

MODULE	PH2S(SREG=#17,VREG=#15,FREG=#16,DREGS=4,RESERVE(0,1,2,3),START,GLOROUTINES) =
BEGIN

SWITCHES NOLIST;
REQUIRE FIRST.BLI;
REQUIRE TABLES.BLI;
SWITCHES LIST;

GLOBAL BIND PH2SV = 6^24 + 0^18 + 31;	! Version Date: 20-Jul-81

%(

***** Begin Revision History *****

30	-----	-----	DELETE REFERENCE TO NOFRTEMP

***** Begin Version 6 *****

31	1047	EGM	22-Jan-81	Q10-05325
	Add support for TOPS-10 execute only.

***** End Revision History *****

)%

	EXTERNAL P2SKL1DISP;

%[1047]% PORTAL ROUTINE MRP2S =
BEGIN


%(****THIS MODULE MAKES A PASS OVER THE SOURCE PROGRAM, PERFORMING PHASE 2 SKEL
	AND COMMON SUBEXPR ELIMINATION FOR ALL STATEMENTS***)%
	EXTERNAL SEGINCORE,PHAZCONTROL;
	EXTERNAL P2SKSTMNT,CSTMNT;
	EXTERNAL LOCELIM;
	EXTERNAL MEMCMCHK;
	EXTERNAL BACKST,CORMAN,LENTRY,DOWDP,CDONODE;
	EXTERNAL MAKASSOC;	!ROUTINE TO SET UP LIST OF ALL ASSOCIATE VARS
				! IN THE PROGRAM

	MAP BASE CSTMNT;

	EXTERNAL INNERLOOP;	!GLOBAL FLAG THAT IS SET WHILE PROCESSING
				! STMNTS IN AN INNER LOOP



	%(***INIT GLOBALS USED BY COMMON SUBEXPR ELIM***)%
	NAME<LEFT>_SRCSIZ+ASGNSIZ;
	BACKST_CORMAN();
	LENTRY_0;

	%(***INIT GLOBAL USED BY THE ROUTINE THAT SUBSTITUTES REGCONTENTS NODES FOR DO
		CONTROL VARIABLE*****)%
	DOWDP_0;

	INNERLOOP_FALSE;	!INIT FLAG FOR "ARE CURRENTLY PROCESSING STMNTS
				! IN AN INNER LOOP"

	NAME<LEFT>_SRCSIZ+DOSIZ;	!MAKE A DUMMY DO STMNT WHICH HAS
					! ALL WDS ZERO
	CDONODE_CORMAN();		!INIT PTR TO "CURRENT INNER DO" TO PT
					! TO THIS DUMMY


	MAKASSOC();	!MAKE A LINKED LIST OF ALL ASSOCIATE VARS IN THE PROGRAM
			! (THIS LIST IS NEEDED BY THE BB REG ALLOCATOR)

	CSTMNT_.SORCPTR<LEFT>;			!GET PTR TO 1ST STMNT OF PROGRAM

	%(***SKIP 1ST STMNT WHICH IS ALWAYS A DUMMY CONTINUE***)%
	IF .CSTMNT NEQ 0
	THEN
	CSTMNT_.CSTMNT[SRCLINK];


	WHILE .CSTMNT NEQ 0
	DO
	BEGIN
		ISN_.CSTMNT[SRCISN];
		P2SKSTMNT();
		LOCELIM(.CSTMNT);		!PERFORM LOCAL COMMON SUBEXPR ELIM
		MEMCMCHK();			!DETECT OPS THAT CAN BE PERFORMED TO MEMORY
		CSTMNT_.CSTMNT[SRCLINK];
	END;

END;			!END OF MRP2S
MACHOP POPJ=#263;
MRP2S();
POPJ(#17,0)