mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 20:22:24 +00:00
Remove o_result variable obsoleted by restoration of alloca usage.
This commit is contained in:
parent
cf49ec30b9
commit
126ef6d479
4 changed files with 9 additions and 28 deletions
|
|
@ -478,11 +478,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *)
|
||||||
END DefineType;
|
END DefineType;
|
||||||
|
|
||||||
PROCEDURE Prefixed(x: OPT.ConstExt; y: ARRAY OF CHAR): BOOLEAN;
|
PROCEDURE Prefixed(x: OPT.ConstExt; y: ARRAY OF CHAR): BOOLEAN;
|
||||||
VAR i: INTEGER; r: BOOLEAN;
|
VAR i: INTEGER;
|
||||||
BEGIN i := 0;
|
BEGIN i := 0;
|
||||||
WHILE x[i+1] = y[i] DO INC(i) END ;
|
WHILE x[i+1] = y[i] DO INC(i) END;
|
||||||
r := y[i] = 0X;
|
RETURN y[i] = 0X;
|
||||||
RETURN r;
|
|
||||||
END Prefixed;
|
END Prefixed;
|
||||||
|
|
||||||
PROCEDURE CProcDefs(obj: OPT.Object; vis: INTEGER);
|
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 ;
|
IF proc^.vis # OPT.external THEN OPM.WriteString('static ') END ;
|
||||||
ProcHeader(proc, TRUE);
|
ProcHeader(proc, TRUE);
|
||||||
BegBlk;
|
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;
|
scope := proc^.scope;
|
||||||
IdentList(scope^.scope, 0);
|
IdentList(scope^.scope, 0);
|
||||||
IF ~scope^.leaf THEN (* declare intermediate procedure scope record variable*)
|
IF ~scope^.leaf THEN (* declare intermediate procedure scope record variable*)
|
||||||
|
|
|
||||||
|
|
@ -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
|
IF Platform.ArgCount = 1 THEN
|
||||||
LogWLn;
|
LogWLn;
|
||||||
LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); 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;
|
LogWStr("Further development by Norayr Chilingarian, David Brown and others."); LogWLn;
|
||||||
LogWLn;
|
LogWLn;
|
||||||
LogWStr("Usage:"); LogWLn;
|
LogWStr("Usage:"); LogWLn;
|
||||||
LogWLn;
|
LogWLn;
|
||||||
LogWStr(" "); LogWStr(Configuration.name); LogWStr(" options {files {options}}."); LogWLn;
|
LogWStr(" "); LogWStr(Configuration.name); LogWStr(" options {files {options}}."); LogWLn;
|
||||||
LogWLn;
|
LogWLn;
|
||||||
LogWStr('Where options = ["-" {option} ].'); LogWLn;
|
LogWStr('Options:'); LogWLn;
|
||||||
LogWLn;
|
LogWLn;
|
||||||
LogWStr(" Run time safety"); LogWLn;
|
LogWStr(" Run time safety"); LogWLn;
|
||||||
LogWStr(" -p Initialise pointers to NIL. On by default."); LogWLn;
|
LogWStr(" -p Initialise pointers to NIL. On by default."); LogWLn;
|
||||||
|
|
|
||||||
|
|
@ -876,19 +876,15 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
|
||||||
| OPT.Nreturn: IF OPM.level = 0 THEN
|
| OPT.Nreturn: IF OPM.level = 0 THEN
|
||||||
IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END
|
IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END
|
||||||
ELSE
|
ELSE
|
||||||
|
OPC.ExitProc(outerProc, FALSE, FALSE);
|
||||||
|
OPM.WriteString("return");
|
||||||
IF n^.left # NIL THEN
|
IF n^.left # NIL THEN
|
||||||
(* Make local copy of result before ExitProc deletes dynamic vars *)
|
OPM.Write(Blank);
|
||||||
OPM.WriteString("_o_result = ");
|
|
||||||
IF (n^.left^.typ^.form = OPT.Pointer) & (n^.obj^.typ # n^.left^.typ) THEN
|
IF (n^.left^.typ^.form = OPT.Pointer) & (n^.obj^.typ # n^.left^.typ) THEN
|
||||||
OPM.WriteString("(void*)"); expr(n^.left, 10)
|
OPM.WriteString("(void*)"); expr(n^.left, 10)
|
||||||
ELSE
|
ELSE
|
||||||
expr(n^.left, MinPrec)
|
expr(n^.left, MinPrec)
|
||||||
END;
|
END
|
||||||
OPM.WriteString(";"); OPM.WriteLn; OPC.BegStat;
|
|
||||||
OPC.ExitProc(outerProc, FALSE, FALSE);
|
|
||||||
OPM.WriteString("return _o_result");
|
|
||||||
ELSE
|
|
||||||
OPM.WriteString("return");
|
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
| OPT.Nwith: IfStat(n, n^.subcl = 0, outerProc)
|
| OPT.Nwith: IfStat(n, n^.subcl = 0, outerProc)
|
||||||
|
|
|
||||||
|
|
@ -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; \
|
#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;}
|
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 __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 __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t))
|
||||||
#define __DEL(x)
|
#define __DEL(x)
|
||||||
|
|
||||||
|
|
@ -168,7 +164,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){
|
||||||
|
|
||||||
#define __VAL(t, x) (*(t*)&(x))
|
#define __VAL(t, x) (*(t*)&(x))
|
||||||
|
|
||||||
|
|
||||||
#define __GET(a, x, t) x=*(t*)(address)(a)
|
#define __GET(a, x, t) x=*(t*)(address)(a)
|
||||||
#define __PUT(a, x, t) *(t*)(address)(a)=x
|
#define __PUT(a, x, t) *(t*)(address)(a)=x
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue