Selaa lähdekoodia

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

Sven/Sarah Barth 3 vuotta sitten
vanhempi
commit
b297199ab6
1 muutettua tiedostoa jossa 9 lisäystä ja 0 poistoa
  1. 9 0
      compiler/symsym.pas

+ 9 - 0
compiler/symsym.pas

@@ -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
 ****************************************************************************}