+ add a field to denote that a symbol (mainly local and parameter ones) was captured through another symbol

This commit is contained in:
Sven/Sarah Barth 2022-02-05 19:31:18 +01:00
parent ec96d4242a
commit b297199ab6

View File

@ -260,12 +260,15 @@ interface
{ the variable is not living at entry of the scope, so it does not need to be initialized if it is a reg. var
(not written to ppu, because not important and would change interface crc) }
noregvarinitneeded : boolean;
{ not stored in PPU! }
capture_sym : tsym;
constructor create(st:tsymtyp;const n : TSymStr;vsp:tvarspez;def:tdef;vopts:tvaroptions);
constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile);
function globalasmsym: boolean;
procedure ppuwrite(ppufile:tcompilerppufile);override;
procedure buildderef;override;
procedure deref;override;
function is_captured:boolean;
end;
tlocalvarsym = class(tabstractnormalvarsym)
@ -2127,6 +2130,12 @@ implementation
end;
function tabstractnormalvarsym.is_captured:boolean;
begin
result:=assigned(capture_sym);
end;
{****************************************************************************
Tstaticvarsym
****************************************************************************}