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

« back to all changes in this revision

Viewing changes to compiler/cgutils.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: cgutils.pas,v 1.1 2004/02/27 10:21:05 florian Exp $
3
 
    Copyright (c) 1998-2004 by Florian Klaempfl
4
 
 
5
 
    Some basic types and constants for the code generation
6
 
 
7
 
    This program is free software; you can redistribute it and/or modify
8
 
    it under the terms of the GNU General Public License as published by
9
 
    the Free Software Foundation; either version 2 of the License, or
10
 
    (at your option) any later version.
11
 
 
12
 
    This program is distributed in the hope that it will be useful,
13
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
    GNU General Public License for more details.
16
 
 
17
 
    You should have received a copy of the GNU General Public License
18
 
    along with this program; if not, write to the Free Software
19
 
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
 
 
21
 
 ****************************************************************************
22
 
}
23
 
{ This unit exports some helper routines which are used across the code generator }
24
 
unit cgutils;
25
 
 
26
 
{$i fpcdefs.inc}
27
 
 
28
 
  interface
29
 
 
30
 
    uses
31
 
      aasmbase,
32
 
      cgbase,
33
 
      cpubase;
34
 
 
35
 
    { trerefence handling }
36
 
 
37
 
    {# Clear to zero a treference }
38
 
    procedure reference_reset(var ref : treference);
39
 
    {# Clear to zero a treference, and set is base address
40
 
       to base register.
41
 
    }
42
 
    procedure reference_reset_base(var ref : treference;base : tregister;offset : longint);
43
 
    procedure reference_reset_symbol(var ref : treference;sym : tasmsymbol;offset : longint);
44
 
    { This routine verifies if two references are the same, and
45
 
       if so, returns TRUE, otherwise returns false.
46
 
    }
47
 
    function references_equal(sref : treference;dref : treference) : boolean;
48
 
 
49
 
  implementation
50
 
 
51
 
{****************************************************************************
52
 
                                  TReference
53
 
****************************************************************************}
54
 
 
55
 
    procedure reference_reset(var ref : treference);
56
 
      begin
57
 
        FillChar(ref,sizeof(treference),0);
58
 
{$ifdef arm}
59
 
        ref.signindex:=1;
60
 
{$endif arm}
61
 
      end;
62
 
 
63
 
 
64
 
    procedure reference_reset_base(var ref : treference;base : tregister;offset : longint);
65
 
      begin
66
 
        reference_reset(ref);
67
 
        ref.base:=base;
68
 
        ref.offset:=offset;
69
 
      end;
70
 
 
71
 
 
72
 
    procedure reference_reset_symbol(var ref : treference;sym : tasmsymbol;offset : longint);
73
 
      begin
74
 
        reference_reset(ref);
75
 
        ref.symbol:=sym;
76
 
        ref.offset:=offset;
77
 
      end;
78
 
 
79
 
 
80
 
    function references_equal(sref : treference;dref : treference):boolean;
81
 
      begin
82
 
        references_equal:=CompareByte(sref,dref,sizeof(treference))=0;
83
 
      end;
84
 
 
85
 
end.
86
 
{
87
 
  $Log: cgutils.pas,v $
88
 
  Revision 1.1  2004/02/27 10:21:05  florian
89
 
    * top_symbol killed
90
 
    + refaddr to treference added
91
 
    + refsymbol to treference added
92
 
    * top_local stuff moved to an extra record to save memory
93
 
    + aint introduced
94
 
    * tppufile.get/putint64/aint implemented
95
 
}