2
$Id: symnot.pas,v 1.3 2003/10/22 15:22:33 peter Exp $
3
Copyright (c) 2002 by Daniel Mantione
5
This unit contains support routines for the variable access
8
This program is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2 of the License, or
11
(at your option) any later version.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
****************************************************************************
31
uses cclasses,symtype;
33
type Tnotification_flag=(vn_onread,vn_onwrite,vn_unknown);
34
Tnotification_flags=set of Tnotification_flag;
36
Tnotification_callback=procedure(not_type:Tnotification_flag;
37
symbol:Tsym) of object;
39
Tnotification=class(Tlinkedlistitem)
40
flags:Tnotification_flags;
41
callback:Tnotification_callback;
43
constructor create(Aflags:Tnotification_flags;
44
Acallback:Tnotification_callback);
49
var notification_counter:cardinal;
51
constructor Tnotification.create(Aflags:Tnotification_flags;
52
Acallback:Tnotification_callback);
58
id:=notification_counter;
59
inc(notification_counter);
63
notification_counter:=0;
68
Revision 1.3 2003/10/22 15:22:33 peter
69
* fixed unitsym-globalsymtable relation so the uses of a unit
72
Revision 1.2 2002/12/31 09:55:58 daniel
73
+ Notification implementation complete
74
+ Add for loop code optimization using notifications
75
results in 1.5-1.9% speed improvement in nestloop benchmark
76
Optimization incomplete, compiler does not cycle yet with
77
notifications enabled.
79
Revision 1.1 2002/09/01 08:04:42 daniel
80
+ Added read/write notifications of variables. These will be usefull
81
for providing information for several optimizations. For example
82
the value of the loop variable of a for loop does matter is the
83
variable is read after the for loop, but if it's no longer used
84
or written, it doesn't matter and this can be used to optimize
85
the loop code generation.