~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to compiler/symnot.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{
2
 
    $Id: symnot.pas,v 1.3 2003/10/22 15:22:33 peter Exp $
3
 
    Copyright (c) 2002 by Daniel Mantione
4
 
 
5
 
    This unit contains support routines for the variable access
6
 
    notifier.
7
 
 
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.
12
 
 
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.
17
 
 
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.
21
 
 
22
 
 ****************************************************************************
23
 
}
24
 
 
25
 
unit symnot;
26
 
 
27
 
{$i fpcdefs.inc}
28
 
 
29
 
interface
30
 
 
31
 
uses  cclasses,symtype;
32
 
 
33
 
type  Tnotification_flag=(vn_onread,vn_onwrite,vn_unknown);
34
 
      Tnotification_flags=set of Tnotification_flag;
35
 
 
36
 
      Tnotification_callback=procedure(not_type:Tnotification_flag;
37
 
                                       symbol:Tsym) of object;
38
 
 
39
 
      Tnotification=class(Tlinkedlistitem)
40
 
        flags:Tnotification_flags;
41
 
        callback:Tnotification_callback;
42
 
        id:cardinal;
43
 
        constructor create(Aflags:Tnotification_flags;
44
 
                           Acallback:Tnotification_callback);
45
 
      end;
46
 
 
47
 
implementation
48
 
 
49
 
var notification_counter:cardinal;
50
 
 
51
 
constructor Tnotification.create(Aflags:Tnotification_flags;
52
 
                                 Acallback:Tnotification_callback);
53
 
 
54
 
begin
55
 
  inherited create;
56
 
  flags:=Aflags;
57
 
  callback:=Acallback;
58
 
  id:=notification_counter;
59
 
  inc(notification_counter);
60
 
end;
61
 
 
62
 
begin
63
 
  notification_counter:=0;
64
 
end.
65
 
 
66
 
{
67
 
  $Log: symnot.pas,v $
68
 
  Revision 1.3  2003/10/22 15:22:33  peter
69
 
    * fixed unitsym-globalsymtable relation so the uses of a unit
70
 
      is counted correctly
71
 
 
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.
78
 
 
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.
86
 
 
87
 
}