Browse Source

- removed variable notification support, it's not used and superceded by
DFA

git-svn-id: trunk@31916 -

Jonas Maebe 9 năm trước cách đây
mục cha
commit
95927665ce
6 tập tin đã thay đổi với 2 bổ sung162 xóa
  1. 0 1
      .gitattributes
  2. 0 1
      compiler/ncgnstld.pas
  3. 0 22
      compiler/nflw.pas
  4. 1 5
      compiler/nld.pas
  5. 0 63
      compiler/symnot.pas
  6. 1 70
      compiler/symsym.pas

+ 0 - 1
.gitattributes

@@ -688,7 +688,6 @@ compiler/symbase.pas svneol=native#text/plain
 compiler/symconst.pas svneol=native#text/plain
 compiler/symcreat.pas svneol=native#text/plain
 compiler/symdef.pas svneol=native#text/plain
-compiler/symnot.pas svneol=native#text/plain
 compiler/symsym.pas svneol=native#text/plain
 compiler/symtable.pas svneol=native#text/plain
 compiler/symtype.pas svneol=native#text/plain

+ 0 - 1
compiler/ncgnstld.pas

@@ -56,7 +56,6 @@ implementation
 
     uses
       cutils,verbose,globtype,globals,systems,constexp,
-      symnot,
       defutil,defcmp,
       htypechk,pass_1,procinfo,paramgr,
       cpuinfo,

+ 0 - 22
compiler/nflw.pas

@@ -29,7 +29,6 @@ interface
     uses
       cclasses,
       node,cpubase,
-      symnot,
       symtype,symbase,symdef,symsym,
       optloop;
 
@@ -102,7 +101,6 @@ interface
           loopiteration : tnode;
           loopvar_notid:cardinal;
           constructor create(l,r,_t1,_t2 : tnode;back : boolean);virtual;reintroduce;
-          procedure loop_var_access(not_type:Tnotification_flag;symbol:Tsym);
           function wrap_to_value:tnode;
           function pass_typecheck:tnode;override;
           function pass_1 : tnode;override;
@@ -1443,26 +1441,6 @@ implementation
          include(loopflags,lnf_testatbegin);
       end;
 
-    procedure Tfornode.loop_var_access(not_type:Tnotification_flag;
-                                       symbol:Tsym);
-
-    begin
-      {If there is a read access, the value of the loop counter is important;
-       at the end of the loop the loop variable should contain the value it
-       had in the last iteration.}
-      if not_type=vn_onwrite then
-        begin
-          writeln('Loopvar does not matter on exit');
-        end
-      else
-        begin
-          exclude(loopflags,lnf_dont_mind_loopvar_on_exit);
-          writeln('Loopvar does matter on exit');
-        end;
-      Tabstractvarsym(symbol).unregister_notification(loopvar_notid);
-    end;
-
-
     function tfornode.simplify(forinline : boolean) : tnode;
       begin
         result:=nil;

+ 1 - 5
compiler/nld.pas

@@ -174,7 +174,7 @@ implementation
 
     uses
       verbose,globtype,globals,systems,constexp,
-      symnot,symtable,
+      symtable,
       defutil,defcmp,
       htypechk,pass_1,procinfo,paramgr,
       cpuinfo,
@@ -417,10 +417,6 @@ implementation
                 { call to get address of threadvar }
                 if (vo_is_thread_var in tabstractvarsym(symtableentry).varoptions) then
                   include(current_procinfo.flags,pi_do_call);
-                if nf_write in flags then
-                  Tabstractvarsym(symtableentry).trigger_notifications(vn_onwrite)
-                else
-                  Tabstractvarsym(symtableentry).trigger_notifications(vn_onread);
               end;
             procsym :
                 begin

+ 0 - 63
compiler/symnot.pas

@@ -1,63 +0,0 @@
-{
-    Copyright (c) 2002 by Daniel Mantione
-
-    This unit contains support routines for the variable access
-    notifier.
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- ****************************************************************************
-}
-
-unit symnot;
-
-{$i fpcdefs.inc}
-
-interface
-
-uses  cclasses,symtype;
-
-type  Tnotification_flag=(vn_onread,vn_onwrite,vn_unknown);
-      Tnotification_flags=set of Tnotification_flag;
-
-      Tnotification_callback=procedure(not_type:Tnotification_flag;
-                                       symbol:Tsym) of object;
-
-      Tnotification=class(Tlinkedlistitem)
-        flags:Tnotification_flags;
-        callback:Tnotification_callback;
-        id:cardinal;
-        constructor create(Aflags:Tnotification_flags;
-                           Acallback:Tnotification_callback);
-      end;
-
-implementation
-
-var notification_counter:cardinal;
-
-constructor Tnotification.create(Aflags:Tnotification_flags;
-                                 Acallback:Tnotification_callback);
-
-begin
-  inherited create;
-  flags:=Aflags;
-  callback:=Acallback;
-  id:=notification_counter;
-  inc(notification_counter);
-end;
-
-begin
-  notification_counter:=0;
-end.

+ 1 - 70
compiler/symsym.pas

@@ -33,7 +33,7 @@ interface
        symconst,symbase,symtype,symdef,defcmp,
        { ppu }
        ppu,finput,
-       cclasses,symnot,
+       cclasses,
        { aasm }
        aasmbase,
        cpuinfo,cpubase,cgbase,cgutils,parabase
@@ -171,7 +171,6 @@ interface
 
        tabstractvarsym = class(tstoredsym)
           varoptions    : tvaroptions;
-          notifications : Tlinkedlist;
           varspez       : tvarspez;  { sets the type of access }
           varregable    : tvarregable;
           varstate      : tvarstate;
@@ -182,17 +181,12 @@ interface
           addr_taken     : boolean;
           constructor create(st:tsymtyp;const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);
           constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile);
-          destructor  destroy;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderef;override;
           procedure deref;override;
           function  getsize : asizeint;
           function  getpackedbitsize : longint;
           function  is_regvar(refpara: boolean):boolean;
-          procedure trigger_notifications(what:Tnotification_flag);
-          function register_notification(flags:Tnotification_flags;
-                                         callback:Tnotification_callback):cardinal;
-          procedure unregister_notification(id:cardinal);
         private
           _vardef     : tdef;
           vardefderef : tderef;
@@ -1596,14 +1590,6 @@ implementation
       end;
 
 
-    destructor tabstractvarsym.destroy;
-      begin
-        if assigned(notifications) then
-          notifications.destroy;
-        inherited destroy;
-      end;
-
-
     procedure tabstractvarsym.buildderef;
       begin
         vardefderef.build(vardef);
@@ -1686,61 +1672,6 @@ implementation
       end;
 
 
-    procedure tabstractvarsym.trigger_notifications(what:Tnotification_flag);
-
-    var n:Tnotification;
-
-    begin
-        if assigned(notifications) then
-          begin
-            n:=Tnotification(notifications.first);
-            while assigned(n) do
-              begin
-                if what in n.flags then
-                  n.callback(what,self);
-                n:=Tnotification(n.next);
-              end;
-          end;
-    end;
-
-    function Tabstractvarsym.register_notification(flags:Tnotification_flags;callback:
-                                           Tnotification_callback):cardinal;
-
-    var n:Tnotification;
-
-    begin
-      if not assigned(notifications) then
-        notifications:=Tlinkedlist.create;
-      n:=Tnotification.create(flags,callback);
-      register_notification:=n.id;
-      notifications.concat(n);
-    end;
-
-    procedure Tabstractvarsym.unregister_notification(id:cardinal);
-
-    var n:Tnotification;
-
-    begin
-      if not assigned(notifications) then
-        internalerror(200212311)
-      else
-        begin
-            n:=Tnotification(notifications.first);
-            while assigned(n) do
-              begin
-                if n.id=id then
-                  begin
-                    notifications.remove(n);
-                    n.destroy;
-                    exit;
-                  end;
-                n:=Tnotification(n.next);
-              end;
-            internalerror(200212311)
-        end;
-    end;
-
-
     procedure tabstractvarsym.setvardef(def:tdef);
       begin
         _vardef := def;