mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 23:40:14 +02:00
- removed variable notification support, it's not used and superceded by
DFA git-svn-id: trunk@31916 -
This commit is contained in:
parent
7fb2418287
commit
95927665ce
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -688,7 +688,6 @@ compiler/symbase.pas svneol=native#text/plain
|
|||||||
compiler/symconst.pas svneol=native#text/plain
|
compiler/symconst.pas svneol=native#text/plain
|
||||||
compiler/symcreat.pas svneol=native#text/plain
|
compiler/symcreat.pas svneol=native#text/plain
|
||||||
compiler/symdef.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/symsym.pas svneol=native#text/plain
|
||||||
compiler/symtable.pas svneol=native#text/plain
|
compiler/symtable.pas svneol=native#text/plain
|
||||||
compiler/symtype.pas svneol=native#text/plain
|
compiler/symtype.pas svneol=native#text/plain
|
||||||
|
@ -56,7 +56,6 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
cutils,verbose,globtype,globals,systems,constexp,
|
cutils,verbose,globtype,globals,systems,constexp,
|
||||||
symnot,
|
|
||||||
defutil,defcmp,
|
defutil,defcmp,
|
||||||
htypechk,pass_1,procinfo,paramgr,
|
htypechk,pass_1,procinfo,paramgr,
|
||||||
cpuinfo,
|
cpuinfo,
|
||||||
|
@ -29,7 +29,6 @@ interface
|
|||||||
uses
|
uses
|
||||||
cclasses,
|
cclasses,
|
||||||
node,cpubase,
|
node,cpubase,
|
||||||
symnot,
|
|
||||||
symtype,symbase,symdef,symsym,
|
symtype,symbase,symdef,symsym,
|
||||||
optloop;
|
optloop;
|
||||||
|
|
||||||
@ -102,7 +101,6 @@ interface
|
|||||||
loopiteration : tnode;
|
loopiteration : tnode;
|
||||||
loopvar_notid:cardinal;
|
loopvar_notid:cardinal;
|
||||||
constructor create(l,r,_t1,_t2 : tnode;back : boolean);virtual;reintroduce;
|
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 wrap_to_value:tnode;
|
||||||
function pass_typecheck:tnode;override;
|
function pass_typecheck:tnode;override;
|
||||||
function pass_1 : tnode;override;
|
function pass_1 : tnode;override;
|
||||||
@ -1443,26 +1441,6 @@ implementation
|
|||||||
include(loopflags,lnf_testatbegin);
|
include(loopflags,lnf_testatbegin);
|
||||||
end;
|
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;
|
function tfornode.simplify(forinline : boolean) : tnode;
|
||||||
begin
|
begin
|
||||||
result:=nil;
|
result:=nil;
|
||||||
|
@ -174,7 +174,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
verbose,globtype,globals,systems,constexp,
|
verbose,globtype,globals,systems,constexp,
|
||||||
symnot,symtable,
|
symtable,
|
||||||
defutil,defcmp,
|
defutil,defcmp,
|
||||||
htypechk,pass_1,procinfo,paramgr,
|
htypechk,pass_1,procinfo,paramgr,
|
||||||
cpuinfo,
|
cpuinfo,
|
||||||
@ -417,10 +417,6 @@ implementation
|
|||||||
{ call to get address of threadvar }
|
{ call to get address of threadvar }
|
||||||
if (vo_is_thread_var in tabstractvarsym(symtableentry).varoptions) then
|
if (vo_is_thread_var in tabstractvarsym(symtableentry).varoptions) then
|
||||||
include(current_procinfo.flags,pi_do_call);
|
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;
|
end;
|
||||||
procsym :
|
procsym :
|
||||||
begin
|
begin
|
||||||
|
@ -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.
|
|
@ -33,7 +33,7 @@ interface
|
|||||||
symconst,symbase,symtype,symdef,defcmp,
|
symconst,symbase,symtype,symdef,defcmp,
|
||||||
{ ppu }
|
{ ppu }
|
||||||
ppu,finput,
|
ppu,finput,
|
||||||
cclasses,symnot,
|
cclasses,
|
||||||
{ aasm }
|
{ aasm }
|
||||||
aasmbase,
|
aasmbase,
|
||||||
cpuinfo,cpubase,cgbase,cgutils,parabase
|
cpuinfo,cpubase,cgbase,cgutils,parabase
|
||||||
@ -171,7 +171,6 @@ interface
|
|||||||
|
|
||||||
tabstractvarsym = class(tstoredsym)
|
tabstractvarsym = class(tstoredsym)
|
||||||
varoptions : tvaroptions;
|
varoptions : tvaroptions;
|
||||||
notifications : Tlinkedlist;
|
|
||||||
varspez : tvarspez; { sets the type of access }
|
varspez : tvarspez; { sets the type of access }
|
||||||
varregable : tvarregable;
|
varregable : tvarregable;
|
||||||
varstate : tvarstate;
|
varstate : tvarstate;
|
||||||
@ -182,17 +181,12 @@ interface
|
|||||||
addr_taken : boolean;
|
addr_taken : boolean;
|
||||||
constructor create(st:tsymtyp;const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);
|
constructor create(st:tsymtyp;const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);
|
||||||
constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile);
|
constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile);
|
||||||
destructor destroy;override;
|
|
||||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||||
procedure buildderef;override;
|
procedure buildderef;override;
|
||||||
procedure deref;override;
|
procedure deref;override;
|
||||||
function getsize : asizeint;
|
function getsize : asizeint;
|
||||||
function getpackedbitsize : longint;
|
function getpackedbitsize : longint;
|
||||||
function is_regvar(refpara: boolean):boolean;
|
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
|
private
|
||||||
_vardef : tdef;
|
_vardef : tdef;
|
||||||
vardefderef : tderef;
|
vardefderef : tderef;
|
||||||
@ -1596,14 +1590,6 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
destructor tabstractvarsym.destroy;
|
|
||||||
begin
|
|
||||||
if assigned(notifications) then
|
|
||||||
notifications.destroy;
|
|
||||||
inherited destroy;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure tabstractvarsym.buildderef;
|
procedure tabstractvarsym.buildderef;
|
||||||
begin
|
begin
|
||||||
vardefderef.build(vardef);
|
vardefderef.build(vardef);
|
||||||
@ -1686,61 +1672,6 @@ implementation
|
|||||||
end;
|
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);
|
procedure tabstractvarsym.setvardef(def:tdef);
|
||||||
begin
|
begin
|
||||||
_vardef := def;
|
_vardef := def;
|
||||||
|
Loading…
Reference in New Issue
Block a user