mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-06-09 16:29:30 +00:00
Simplify address calculation for auto initializers.
This simplifies the code in the compiler, and also generates better code when not using optimization.
This commit is contained in:
parent
5871820e0c
commit
a888206111
18
Parser.pas
18
Parser.pas
|
@ -4276,20 +4276,10 @@ var
|
||||||
{ Load the address of the operand }
|
{ Load the address of the operand }
|
||||||
|
|
||||||
begin {LoadAddress}
|
begin {LoadAddress}
|
||||||
with id^ do {load the base address}
|
if id^.storage = stackFrame then
|
||||||
case storage of
|
Gen2(pc_lda, id^.lln, ord(disp))
|
||||||
stackFrame: Gen2(pc_lda, lln, 0);
|
else
|
||||||
parameter: if itype^.kind = arrayType then
|
Error(57);
|
||||||
Gen2t(pc_lod, pln, 0, cgULong)
|
|
||||||
else
|
|
||||||
Gen2(pc_lda, pln, 0);
|
|
||||||
external,
|
|
||||||
global,
|
|
||||||
private: Gen1Name(pc_lao, 0, name);
|
|
||||||
otherwise: ;
|
|
||||||
end; {case}
|
|
||||||
if disp <> 0 then
|
|
||||||
Gen1t(pc_inc, long(disp).lsw, cgULong)
|
|
||||||
end; {LoadAddress}
|
end; {LoadAddress}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user