From 17c5c8a5ee243fd9b68af7beeb9351a4ee215b9b Mon Sep 17 00:00:00 2001 From: Geert Bosch Date: Thu, 20 Dec 2001 07:22:43 +0100 Subject: bindgen.adb: Minor reformatting * 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 From-SVN: r48195 --- gcc/ada/fmap.adb | 81 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 40 insertions(+), 41 deletions(-) (limited to 'gcc/ada/fmap.adb') diff --git a/gcc/ada/fmap.adb b/gcc/ada/fmap.adb index 89b3fd8..54409cd9e 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; -- cgit v1.1