diff options
author | Vincent Celier <celier@adacore.com> | 2007-08-14 10:43:34 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-08-14 10:43:34 +0200 |
commit | 2cd44f5a448ad1e160edae120cc7b945ca1a5db3 (patch) | |
tree | 5875d0102588a0bdaf32f61cb26f856f87ff7ec6 /gcc/ada/fmap.adb | |
parent | c9b9ec14ece5acf23bf0817633914e28c43c0678 (diff) | |
download | gcc-2cd44f5a448ad1e160edae120cc7b945ca1a5db3.zip gcc-2cd44f5a448ad1e160edae120cc7b945ca1a5db3.tar.gz gcc-2cd44f5a448ad1e160edae120cc7b945ca1a5db3.tar.bz2 |
clean.adb, [...] (Create_Sym_Links): New procedure.
2007-08-14 Vincent Celier <celier@adacore.com>
* clean.adb, fmap.adb, sinput-p.adb, sinput-p.ads, gnatcmd.adb,
gnatname.adb, makeutl.ads, makeutl.adb, makegpr.adb, mlib-tgt-vms.adb
mlib-tgt-darwin.adb, mlib-tgt-lynxos.adb, mlib-prj.adb, mlib-tgt.adb,
mlib-tgt.ads, mlib-tgt-irix.adb mlib-tgt-hpux.adb, mlib-tgt-linux.adb,
mlib-tgt-solaris.adb, mlib-tgt-vms-alpha.adb, mlib-tgt-vms-ia64.adb,
mlib-tgt-mingw.adb, mlib-tgt-vxworks.adb, mlib-tgt-aix.adb,
mlib-tgt-tru64.adb, mlib.ads, mlib.adb (Create_Sym_Links): New
procedure.
(Major_Id_Name): New function.
mlib-tgt.ads/mlib.tgt.adb:
(Library_Major_Minor_Id_Supported): New function, default returns True
Most mlib-tgt-*.adb that support shared libraries and symbolic links:
(Build_Dynamic_Library): Add support for major/minor ids for shared libs
Other mlib-tgt-*.adb (aix, mingw, vms, vxworks, xi):
Implementation of Library_Major_Minor_Id_Supported returns False
clean.adb:
(Clean_Library_Directory): If major/minor ids are supported, clean all
library files.
Major update of the Project Manager and of the project aware tools,
including gprmake, so that the same sources in the GNAT repository
can be used by gprbuild.
From-SVN: r127432
Diffstat (limited to 'gcc/ada/fmap.adb')
-rw-r--r-- | gcc/ada/fmap.adb | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/gcc/ada/fmap.adb b/gcc/ada/fmap.adb index 381ef27..ea4a258 100644 --- a/gcc/ada/fmap.adb +++ b/gcc/ada/fmap.adb @@ -133,15 +133,26 @@ package body Fmap is File_Name : File_Name_Type; Path_Name : File_Name_Type) is + Unit_Entry : constant Int := Unit_Hash_Table.Get (Unit_Name); + File_Entry : constant Int := File_Hash_Table.Get (File_Name); begin - File_Mapping.Increment_Last; - Unit_Hash_Table.Set (Unit_Name, File_Mapping.Last); - File_Mapping.Table (File_Mapping.Last) := - (Uname => Unit_Name, Fname => File_Name); - Path_Mapping.Increment_Last; - File_Hash_Table.Set (File_Name, Path_Mapping.Last); - Path_Mapping.Table (Path_Mapping.Last) := - (Uname => Unit_Name, Fname => Path_Name); + if Unit_Entry = No_Entry or else + File_Mapping.Table (Unit_Entry).Fname /= File_Name + then + File_Mapping.Increment_Last; + Unit_Hash_Table.Set (Unit_Name, File_Mapping.Last); + File_Mapping.Table (File_Mapping.Last) := + (Uname => Unit_Name, Fname => File_Name); + end if; + + if File_Entry = No_Entry or else + Path_Mapping.Table (File_Entry).Fname /= Path_Name + then + Path_Mapping.Increment_Last; + File_Hash_Table.Set (File_Name, Path_Mapping.Last); + Path_Mapping.Table (Path_Mapping.Last) := + (Uname => Unit_Name, Fname => Path_Name); + end if; end Add_To_File_Map; ---------- @@ -352,18 +363,6 @@ package body Fmap is Name_Buffer (1 .. Name_Len) := SP (First .. Last); Pname := Find_File_Name; - -- Check for duplicate entries - - if Unit_Hash_Table.Get (Uname) /= No_Entry then - Empty_Tables; - return; - end if; - - if File_Hash_Table.Get (Fname) /= No_Entry then - Empty_Tables; - return; - end if; - -- Add the mappings for this unit name Add_To_File_Map (Uname, Fname, Pname); @@ -442,6 +441,8 @@ package body Fmap is File : File_Descriptor; N_Bytes : Integer; + File_Entry : Int; + Status : Boolean; -- For the call to Close @@ -509,13 +510,15 @@ package body Fmap is for Unit in Last_In_Table + 1 .. File_Mapping.Last loop Put_Line (Name_Id (File_Mapping.Table (Unit).Uname)); Put_Line (Name_Id (File_Mapping.Table (Unit).Fname)); - Put_Line (Name_Id (Path_Mapping.Table (Unit).Fname)); + File_Entry := + File_Hash_Table.Get (File_Mapping.Table (Unit).Fname); + Put_Line (Name_Id (Path_Mapping.Table (File_Entry).Fname)); end loop; - -- Before closing the file, write the buffer to the file. - -- It is guaranteed that the Buffer is not empty, because - -- Put_Line has been called at least 3 times, and after - -- a call to Put_Line, the Buffer is not empty. + -- Before closing the file, write the buffer to the file. It is + -- guaranteed that the Buffer is not empty, because Put_Line has + -- been called at least 3 times, and after a call to Put_Line, the + -- Buffer is not empty. N_Bytes := Write (File, Buffer (1)'Address, Buffer_Last); |