Remove o_result variable obsoleted by restoration of alloca usage.

This commit is contained in:
David Brown 2016-10-28 19:06:08 +01:00
parent cf49ec30b9
commit 126ef6d479
4 changed files with 9 additions and 28 deletions

View file

@ -478,11 +478,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *)
END DefineType;
PROCEDURE Prefixed(x: OPT.ConstExt; y: ARRAY OF CHAR): BOOLEAN;
VAR i: INTEGER; r: BOOLEAN;
VAR i: INTEGER;
BEGIN i := 0;
WHILE x[i+1] = y[i] DO INC(i) END;
r := y[i] = 0X;
RETURN r;
RETURN y[i] = 0X;
END Prefixed;
PROCEDURE CProcDefs(obj: OPT.Object; vis: INTEGER);
@ -957,15 +956,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *)
IF proc^.vis # OPT.external THEN OPM.WriteString('static ') END ;
ProcHeader(proc, TRUE);
BegBlk;
(* If there will be a result, provide a result variable. *)
IF proc^.typ # OPT.notyp THEN
BegStat;
Ident(proc^.typ^.strobj);
OPM.WriteString(" _o_result;");
OPM.WriteLn;
END;
scope := proc^.scope;
IdentList(scope^.scope, 0);
IF ~scope^.leaf THEN (* declare intermediate procedure scope record variable*)

View file

@ -236,14 +236,14 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
IF Platform.ArgCount = 1 THEN
LogWLn;
LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn;
LogWStr("Based on Ofront by Software Templ OEG."); LogWLn;
LogWStr("Based on Ofront by J. Templ and Software Templ OEG."); LogWLn;
LogWStr("Further development by Norayr Chilingarian, David Brown and others."); LogWLn;
LogWLn;
LogWStr("Usage:"); LogWLn;
LogWLn;
LogWStr(" "); LogWStr(Configuration.name); LogWStr(" options {files {options}}."); LogWLn;
LogWLn;
LogWStr('Where options = ["-" {option} ].'); LogWLn;
LogWStr('Options:'); LogWLn;
LogWLn;
LogWStr(" Run time safety"); LogWLn;
LogWStr(" -p Initialise pointers to NIL. On by default."); LogWLn;

View file

@ -876,19 +876,15 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
| OPT.Nreturn: IF OPM.level = 0 THEN
IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END
ELSE
OPC.ExitProc(outerProc, FALSE, FALSE);
OPM.WriteString("return");
IF n^.left # NIL THEN
(* Make local copy of result before ExitProc deletes dynamic vars *)
OPM.WriteString("_o_result = ");
OPM.Write(Blank);
IF (n^.left^.typ^.form = OPT.Pointer) & (n^.obj^.typ # n^.left^.typ) THEN
OPM.WriteString("(void*)"); expr(n^.left, 10)
ELSE
expr(n^.left, MinPrec)
END;
OPM.WriteString(";"); OPM.WriteLn; OPC.BegStat;
OPC.ExitProc(outerProc, FALSE, FALSE);
OPM.WriteString("return _o_result");
ELSE
OPM.WriteString("return");
END
END
END
| OPT.Nwith: IfStat(n, n^.subcl = 0, outerProc)

View file

@ -156,10 +156,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){
#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \
while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;}
#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t))
//#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t))
//#define __DEL(x) Platform_OSFree((address)x)
#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t))
#define __DEL(x)
@ -168,7 +164,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){
#define __VAL(t, x) (*(t*)&(x))
#define __GET(a, x, t) x=*(t*)(address)(a)
#define __PUT(a, x, t) *(t*)(address)(a)=x