summaryrefslogtreecommitdiff
path: root/xrefs.ads
diff options
context:
space:
mode:
authorTristan Gingold2014-11-04 20:14:19 +0100
committerTristan Gingold2014-11-04 20:14:19 +0100
commit9c195bf5d86d67ea5eb419ccf6e48dc153e57c68 (patch)
tree575346e529b99e26382b4a06f6ff2caa0b391ab2 /xrefs.ads
parent184a123f91e07c927292d67462561dc84f3a920d (diff)
downloadghdl-9c195bf5d86d67ea5eb419ccf6e48dc153e57c68.tar.gz
ghdl-9c195bf5d86d67ea5eb419ccf6e48dc153e57c68.tar.bz2
ghdl-9c195bf5d86d67ea5eb419ccf6e48dc153e57c68.zip
Move sources to src/ subdirectory.
Diffstat (limited to 'xrefs.ads')
-rw-r--r--xrefs.ads108
1 files changed, 0 insertions, 108 deletions
diff --git a/xrefs.ads b/xrefs.ads
deleted file mode 100644
index 74f2d0c..0000000
--- a/xrefs.ads
+++ /dev/null
@@ -1,108 +0,0 @@
--- Cross references.
--- Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold
---
--- GHDL 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, or (at your option) any later
--- version.
---
--- GHDL 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 GHDL; see the file COPYING. If not, write to the Free
--- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
--- 02111-1307, USA.
-with Types; use Types;
-with Iirs; use Iirs;
-
-package Xrefs is
- type Xref_Kind is
- (
- -- Declaration of an identifier.
- Xref_Decl,
-
- -- Use of a named entity.
- Xref_Ref,
-
- -- Identifier after the 'end' keyword.
- Xref_End,
-
- -- Body of a declaration (for package, subprograms or protected type).
- Xref_Body
- );
-
- -- Initialize the xref table.
- -- Must be called once.
- procedure Init;
-
- -- Low level xref addition.
- -- An entity at LOC references REF with the KIND way.
- procedure Add_Xref (Loc : Location_Type; Ref : Iir; Kind : Xref_Kind);
-
- -- Add a declaration of an identifier.
- -- This is somewhat a self-reference.
- procedure Xref_Decl (Decl : Iir);
- pragma Inline (Xref_Decl);
-
- -- NAME refers to DECL.
- procedure Xref_Ref (Name : Iir; Decl : Iir);
- pragma Inline (Xref_Ref);
-
- -- BODy refers to SPEC.
- procedure Xref_Body (Bod : Iir; Spec : Iir);
- pragma Inline (Xref_Body);
-
- -- Just resolved NAME refers to its named entity.
- procedure Xref_Name (Name : Iir);
- pragma Inline (Xref_Name);
-
- -- LOC is the location of the simple_name after 'end' for DECL.
- procedure Xref_End (Loc : Location_Type; Decl : Iir);
- pragma Inline (Xref_End);
-
- -- Sort the xref table by location. This is required before searching with
- -- Find.
- procedure Sort_By_Location;
-
- -- Sort the xref table by location of the nodes.
- procedure Sort_By_Node_Location;
-
- subtype Xref is Natural;
-
- -- A bad xref.
- -- May be returned by Find.
- Bad_Xref : constant Xref := 0;
-
- -- First xref.
- -- May be used to size a table.
- First_Xref : constant Xref := 1;
-
- -- Find a reference by location.
- -- The table must already be sorted with Sort_By_Location.
- -- Returns BAD_REF is does not exist.
- function Find (Loc : Location_Type) return Xref;
-
- -- End_Xrefs are added by parse and points to the subprogram_body.
- -- This procedure make them points to the subprogram_decl node.
- -- This is done so that every node has a name.
- procedure Fix_End_Xrefs;
-
- -- Get the last possible xref available.
- -- May be used to size tables.
- function Get_Last_Xref return Xref;
-
- -- Get the location of N, ie where a name (or operator) appears.
- function Get_Xref_Location (N : Xref) return Location_Type;
- pragma Inline (Get_Xref_Location);
-
- -- Get the kind of cross-reference.
- function Get_Xref_Kind (N : Xref) return Xref_Kind;
- pragma Inline (Get_Xref_Kind);
-
- -- Get the node referenced by the name.
- function Get_Xref_Node (N : Xref) return Iir;
- pragma Inline (Get_Xref_Node);
-end Xrefs;