mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 10:09:19 +02:00
+ add a field to denote that a symbol (mainly local and parameter ones) was captured through another symbol
This commit is contained in:
parent
ec96d4242a
commit
b297199ab6
@ -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
|
{ 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) }
|
(not written to ppu, because not important and would change interface crc) }
|
||||||
noregvarinitneeded : boolean;
|
noregvarinitneeded : boolean;
|
||||||
|
{ not stored in PPU! }
|
||||||
|
capture_sym : tsym;
|
||||||
constructor create(st:tsymtyp;const n : TSymStr;vsp:tvarspez;def:tdef;vopts:tvaroptions);
|
constructor create(st:tsymtyp;const n : TSymStr;vsp:tvarspez;def:tdef;vopts:tvaroptions);
|
||||||
constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile);
|
constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile);
|
||||||
function globalasmsym: boolean;
|
function globalasmsym: boolean;
|
||||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||||
procedure buildderef;override;
|
procedure buildderef;override;
|
||||||
procedure deref;override;
|
procedure deref;override;
|
||||||
|
function is_captured:boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tlocalvarsym = class(tabstractnormalvarsym)
|
tlocalvarsym = class(tabstractnormalvarsym)
|
||||||
@ -2127,6 +2130,12 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tabstractnormalvarsym.is_captured:boolean;
|
||||||
|
begin
|
||||||
|
result:=assigned(capture_sym);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
Tstaticvarsym
|
Tstaticvarsym
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
Loading…
Reference in New Issue
Block a user