Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99h-bb - regal2.c13
There is 1 other file named regal2.c13 in the archive. Click here to see a list.
 REP 19/1	;13C1
	!AUTHOR: S.MURPHY/HPW/MD/DCE/SJW/JNG/EGM/EDS/TFV/RVM/CDM/TJK
 WIT
	!AUTHOR: S.MURPHY/HPW/MD/DCE/SJW/JNG/EGM/EDS/TFV/RVM/CDM/TJK/MEM
 REP 24/1	;13C2
	GLOBAL BIND REGALV = #10^24 + 0^18 + #2402;	! Version Date: 19-Jun-84
 WIT
	GLOBAL BIND REGALV = #10^24 + 0^18 + #2554;	! Version Date: 31-Oct-85
 INS 229/1	;13C3
	2554	MEM	31-Oct-85
		When a SFN calls a user function, VARCLOBB must be called on all
		variables that are passed from the SFN to this user function. Also
		if this SFN calls another SFN which contains a function call, then
		call VARCLOBB on all the parameters to the function call within
		the second SFN.

 INS 262/1	;13C4
	%2554%	UFNCLOBARGS(1),	! Call VARCLOBB on args to user fncalls in SFN
 INS 1/19	;13C5
	GLOBAL ROUTINE UFNCLOBARGS(EXPR)=

	!++
	! FUNCTIONAL DESCRIPTION:
	!
	!	Recursively walk EXPR. Whenever we come across a non-library fncall
	!	call, call VARCLOBB on args that are variables. If this function
	!	is a SFN with the USRFNFLG set, then recursively walk the body of
	!	that SFN.
	!
	! FORMAL PARAMETERS:
	!
	!	EXPR		Expression node
	!
	! IMPLICIT INPUTS:
	!
	!	None
	!
	! IMPLICIT OUTPUTS:
	!
	!	None
	!
	! ROUTINE VALUE:
	!
	!	None
	!
	! SIDE EFFECTS:
	!
	!	None
	!
	!--


	BEGIN	!New [2554]
		MAP BASE EXPR;

		CASE .EXPR[OPRCLS] OF SET
		!BOOLEAN
		BEGIN
			UFNCLOBARGS(.EXPR[ARG1PTR]);
			UFNCLOBARGS(.EXPR[ARG2PTR]);
		END;

		!DATAOPR
		RETURN;

		!RELATIONAL
		BEGIN
			UFNCLOBARGS(.EXPR[ARG1PTR]);
			UFNCLOBARGS(.EXPR[ARG2PTR]);
		END;

		!FNCALL
		BEGIN
			REGISTER ARGUMENTLIST AG;
			REGISTER BASE ARG;
			AG = .EXPR[ARG2PTR];

			IF .EXPR[OPERSP] EQL LIBARY
			THEN
			BEGIN
				INCR I FROM 1 TO .AG[ARGCOUNT]
				DO
				BEGIN
					ARG = .AG[.I,ARGNPTR];
					IF .ARG[OPRCLS] NEQ DATAOPR
					THEN UFNCLOBARGS(.ARG);
				END;
			END
			ELSE
			BEGIN
				INCR I FROM 1 TO .AG[ARGCOUNT]
				DO
				BEGIN
					ARG = .AG[.I,ARGNPTR];
					IF .ARG[OPRCLS] NEQ DATAOPR
					THEN UFNCLOBARGS(.ARG)
					ELSE IF .ARG[OPERSP] EQL VARIABLE
					THEN VARCLOBB(.ARG);	
				END;

				EXPR = .EXPR[ARG1PTR];	!STE FOR FNNAME
				IF .EXPR[IDATTRIBUT(SFN)]
				THEN
				BEGIN
					EXPR = .EXPR[IDSFNODE];	!SFN NODE
					IF .EXPR[USRFNREF]
					THEN
					BEGIN
						EXPR = .EXPR[SFNEXPR];	!ASMNT NODE
						UFNCLOBARGS(.EXPR[RHEXP]); !RHS OF ASMNT
					END;
				END;
			END;
		END;

		!ARITHMETIC
		BEGIN
			UFNCLOBARGS(.EXPR[ARG1PTR]);
			UFNCLOBARGS(.EXPR[ARG2PTR]);
		END;

		!TYPECNV
			UFNCLOBARGS(.EXPR[ARG2PTR]);	

		!ARRAYREF
		BEGIN
			IF .EXPR[ARG2PTR] NEQ 0
			THEN UFNCLOBARGS(.EXPR[ARG2PTR]);
		END;

		!CMNSUB
			UFNCLOBARGS(.EXPR[ARG2PTR]);	

		!NEGNOT
			UFNCLOBARGS(.EXPR[ARG2PTR]);

		!SPECOP
			UFNCLOBARGS(.EXPR[ARG1PTR]);

		!FIELDREF
		RETURN;

		!STORECLS
			UFNCLOBARGS(.EXPR[ARG2PTR]);

		!REGCONTENTS
		RETURN;

		!LABOP
		RETURN;

		!STATEMENT
		RETURN;

		!IOLSCLS
		RETURN;

		!INLINFN
		BEGIN
			UFNCLOBARGS(.EXPR[ARG1PTR]);
			IF .EXPR[ARG2PTR] NEQ 0
			THEN UFNCLOBARGS(.EXPR[ARG2PTR]);
		END;

		!SUBSTRING
		BEGIN
			UFNCLOBARGS(.EXPR[ARG1PTR]);	!Upper bound/length
			UFNCLOBARGS(.EXPR[ARG2PTR]);	!Lower bound
			UFNCLOBARGS(.EXPR[ARG4PTR]);	!Arrayref/dataopr
		END;

		!CONCATENATION
		BEGIN
			LOCAL ARGUMENTLIST AG;
			AG = .EXPR[ARG2PTR];

			INCR I FROM 2 TO .AG[ARGCOUNT]	!Skip first argument
			DO UFNCLOBARGS(.AG[.I,ARGNPTR]);
		END;

		TES;
	END;	! of UFNCLOBARGS

 INS 57/19	;13C6

	%2554%		! If this is a SFN with user function calls in its body
	%2554%		! then call varclobb on the parameters passed to the function
	%2554%		! call within the SFN
	%2554%
	%2554%		CNODE = .CNODE[ARG1PTR];
	%2554%		IF .CNODE[IDATTRIBUT(SFN)]
	%2554%		THEN 
	%2554%		BEGIN
	%2554%			CNODE = .CNODE[IDSFNODE];    ! SFN NODE
	%2554%			IF .CNODE[USRFNREF]
	%2554%			THEN
	%2554%			BEGIN
	%2554%				CNODE = .CNODE[SFNEXPR];   ! ASMNT NODE
	%2554%				UFNCLOBARGS(.CNODE[RHEXP]); ! RHS OF ASMNT
	%2554%			END;
	%2554%		END;
 SUM 254394