summaryrefslogtreecommitdiff
path: root/gcc/ada/fmap.adb
diff options
context:
space:
mode:
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-20 06:22:43 +0000
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-20 06:22:43 +0000
commit4c2698ed6802669784e51f97b390e7f836457407 (patch)
tree0fb5f707e1f7868b6ca9dde005027d1520338a01 /gcc/ada/fmap.adb
parent3affb0ca724651a96e35f3c823e64d123c0cac7d (diff)
downloadgcc-4c2698ed6802669784e51f97b390e7f836457407.tar.gz
* bindgen.adb: Minor reformatting
* cstand.adb: Minor reformatting * fmap.adb: Minor reformatting Change name from Add for Add_To_File_Map (Add is much too generic) Change Path_Name_Of to Mapped_Path_Name Change File_Name_Of to Mapped_File_Name Fix copyright dates in header * fmap.ads: Change name from Add for Add_To_File_Map (Add is much too generic) Change Path_Name_Of to Mapped_Path_Name Change File_Name_Of to Mapped_File_Name Fix copyright dates in header * fname-uf.adb: Minor reformatting. New names of stuff in Fmap. Add use clause for Fmap. * make.adb: Minor reformatting * osint.adb: Minor reformatting. Change of names in Fmap. Add use clause for Fmap. * prj-env.adb: Minor reformatting * prj-env.ads: Minor reformatting * switch.adb: Minor reformatting. Do proper raise of Bad_Switch if error found (there were odd exceptions to this general rule in -gnatec/-gnatem processing) * raise.c (__gnat_eh_personality): Exception handling personality routine for Ada. Still in rough state, inspired from the C++ version and still containing a bunch of debugging artifacts. (parse_lsda_header, get_ttype_entry): Local (static) helpers, also inspired from the C++ library. * raise.c (eh_personality): Add comments. Part of work for the GCC 3 exception handling integration. * Makefile.in: Remove use of 5smastop.adb which is obsolete. (HIE_SOURCES): Add s-secsta.ad{s,b}. (HIE_OBJS): Add s-fat*.o (RAVEN_SOURCES): Remove files that are no longer required. Add interrupt handling files. (RAVEN_MOD): Removed, no longer needed. * a-ngelfu.adb: Remove ??? comment for inappropriate Inline_Always Add 2001 to copyright date * g-regpat.adb: Change pragma Inline_Always to Inline. There is no need to force universal inlining for these cases. * s-taprob.adb: Minor clean ups so that this unit can be used in Ravenscar HI. * exp_ch7.adb: Allow use of secondary stack in HI mode. Disallow it when pragma Restrictions (No_Secondary_Stack) is specified. * prj-tree.ads (Project_Node_Record): Add comments for components Pkg_Id and Case_Insensitive. * g-socket.adb: Minor reformatting. Found while reading code. * prj-tree.ads: Minor reformatting git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48195 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/fmap.adb')
-rw-r--r--gcc/ada/fmap.adb81
1 files changed, 40 insertions, 41 deletions
diff --git a/gcc/ada/fmap.adb b/gcc/ada/fmap.adb
index 89b3fd810f7..54409cd9e35 100644
--- a/gcc/ada/fmap.adb
+++ b/gcc/ada/fmap.adb
@@ -6,9 +6,9 @@
-- --
-- B o d y --
-- --
--- $Revision$
+-- $Revision: 1.1 $
-- --
--- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
+-- Copyright (C) 2001, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -26,14 +26,15 @@
-- --
------------------------------------------------------------------------------
-with GNAT.HTable;
-with Namet; use Namet;
-with Osint; use Osint;
-with Output; use Output;
+with Namet; use Namet;
+with Osint; use Osint;
+with Output; use Output;
with Table;
with Unchecked_Conversion;
+with GNAT.HTable;
+
package body Fmap is
subtype Big_String is String (Positive);
@@ -63,6 +64,7 @@ package body Fmap is
type Header_Num is range 0 .. 1_000;
function Hash (F : Unit_Name_Type) return Header_Num;
+ -- Function used to compute hash of unit name
No_Entry : constant Int := -1;
-- Signals no entry in following table
@@ -87,14 +89,15 @@ package body Fmap is
-- Hash table to map file names to path names. Used in conjunction with
-- table Path_Mapping above.
- ---------
- -- Add --
- ---------
+ ---------------------
+ -- Add_To_File_Map --
+ ---------------------
- procedure Add
+ procedure Add_To_File_Map
(Unit_Name : Unit_Name_Type;
File_Name : File_Name_Type;
- Path_Name : File_Name_Type) is
+ Path_Name : File_Name_Type)
+ is
begin
File_Mapping.Increment_Last;
Unit_Hash_Table.Set (Unit_Name, File_Mapping.Last);
@@ -102,23 +105,7 @@ package body Fmap is
Path_Mapping.Increment_Last;
File_Hash_Table.Set (File_Name, Path_Mapping.Last);
Path_Mapping.Table (Path_Mapping.Last) := Path_Name;
- end Add;
-
- ------------------
- -- File_Name_Of --
- ------------------
-
- function File_Name_Of (Unit : Unit_Name_Type) return File_Name_Type is
- The_Index : constant Int := Unit_Hash_Table.Get (Unit);
- begin
- if The_Index = No_Entry then
- return No_File;
-
- else
- return File_Mapping.Table (The_Index);
- end if;
-
- end File_Name_Of;
+ end Add_To_File_Map;
----------
-- Hash --
@@ -174,10 +161,12 @@ package body Fmap is
procedure Get_Line is
use ASCII;
+
begin
Deb := Fin + 1;
-- If not at the end of file, skip the end of line
+
while Deb < SP'Last
and then (SP (Deb) = CR
or else SP (Deb) = LF
@@ -213,7 +202,7 @@ package body Fmap is
Write_Line (""" is truncated");
end Report_Truncated;
- -- start of procedure Initialize
+ -- Start of procedure Initialize
begin
Name_Len := File_Name'Length;
@@ -230,7 +219,6 @@ package body Fmap is
SP := BS (1 .. Natural (Hi))'Unrestricted_Access;
loop
-
-- Get the unit name
Get_Line;
@@ -303,30 +291,41 @@ package body Fmap is
-- Add the mappings for this unit name
- Add (Uname, Fname, Pname);
-
+ Add_To_File_Map (Uname, Fname, Pname);
end loop;
-
end if;
-
end Initialize;
- ------------------
- -- Path_Name_Of --
- ------------------
+ ----------------------
+ -- Mapped_File_Name --
+ ----------------------
+
+ function Mapped_File_Name (Unit : Unit_Name_Type) return File_Name_Type is
+ The_Index : constant Int := Unit_Hash_Table.Get (Unit);
+
+ begin
+ if The_Index = No_Entry then
+ return No_File;
+ else
+ return File_Mapping.Table (The_Index);
+ end if;
+ end Mapped_File_Name;
+
+ ----------------------
+ -- Mapped_Path_Name --
+ ----------------------
- function Path_Name_Of (File : File_Name_Type) return File_Name_Type is
+ function Mapped_Path_Name (File : File_Name_Type) return File_Name_Type is
Index : Int := No_Entry;
+
begin
Index := File_Hash_Table.Get (File);
if Index = No_Entry then
return No_File;
-
else
return Path_Mapping.Table (Index);
end if;
-
- end Path_Name_Of;
+ end Mapped_Path_Name;
end Fmap;