aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/fmap.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2008-04-08 08:48:30 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-04-08 08:48:30 +0200
commita1e2130ca1fa141e3dcb1ba4913a8f46d33ab9c1 (patch)
tree81431173c33a808bd2956a3c52874efc0dff6252 /gcc/ada/fmap.adb
parent2d7756fa264b9975f7d779bc2e658a6741314e14 (diff)
downloadgcc-a1e2130ca1fa141e3dcb1ba4913a8f46d33ab9c1.zip
gcc-a1e2130ca1fa141e3dcb1ba4913a8f46d33ab9c1.tar.gz
gcc-a1e2130ca1fa141e3dcb1ba4913a8f46d33ab9c1.tar.bz2
back_end.adb: Remove Big_String_Ptr declarations (now in Types)
2008-04-08 Robert Dewar <dewar@adacore.com> * back_end.adb: Remove Big_String_Ptr declarations (now in Types) * errout.adb: Remove Big_String_Ptr declarations (now in Types) Change name Is_Style_Msg to Is_Style_Or_Info_Msg * fmap.adb: Remove Big_String declarations (now in Types) (No_Mapping_File): New Boolean global variable (Initialize): When mapping file cannot be read, set No_Mapping_File to False. (Update_Mapping_File): Do nothing if No_Mapping_File is True. If the tables were empty before adding entries, open the mapping file with Truncate = True, instead of delete/re-create. * fname-sf.adb: Remove Big_String declarations (now in Types) * s-strcom.adb, g-dyntab.ads, g-table.ads, s-carsi8.adb, s-stalib.ads, s-carun8.adb: Add zero size Storage_Size clauses for big pointer types * table.ads: Add for Table_Ptr'Storage_Size use 0 * types.ads: Add Big_String declarations Add Size_Clause of zero for big pointer types From-SVN: r134022
Diffstat (limited to 'gcc/ada/fmap.adb')
-rw-r--r--gcc/ada/fmap.adb31
1 files changed, 12 insertions, 19 deletions
diff --git a/gcc/ada/fmap.adb b/gcc/ada/fmap.adb
index 8f286b3b..b09a524 100644
--- a/gcc/ada/fmap.adb
+++ b/gcc/ada/fmap.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, 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- --
@@ -37,8 +37,10 @@ with GNAT.HTable;
package body Fmap is
- subtype Big_String is String (Positive);
- type Big_String_Ptr is access all Big_String;
+ No_Mapping_File : Boolean := False;
+ -- Set to True when the specified mapping file cannot be read in
+ -- procedure Initialize, so that no attempt is made to oopen the mapping
+ -- file in procedure Update_Mapping_File.
function To_Big_String_Ptr is new Unchecked_Conversion
(Source_Buffer_Ptr, Big_String_Ptr);
@@ -301,6 +303,7 @@ package body Fmap is
Write_Str ("warning: could not read mapping file """);
Write_Str (File_Name);
Write_Line ("""");
+ No_Mapping_File := True;
else
BS := To_Big_String_Ptr (Src);
@@ -479,27 +482,17 @@ package body Fmap is
-- Start of Update_Mapping_File
begin
+ -- If the mapping file could not be read, then it will not be possible
+ -- to update it.
+ if No_Mapping_File then
+ return;
+ end if;
-- Only Update if there are new entries in the mappings
if Last_In_Table < File_Mapping.Last then
- -- If the tables have been emptied, recreate the file.
- -- Otherwise, append to it.
-
- if Last_In_Table = 0 then
- declare
- Discard : Boolean;
- pragma Warnings (Off, Discard);
- begin
- Delete_File (File_Name, Discard);
- end;
-
- File := Create_File (File_Name, Binary);
-
- else
- File := Open_Read_Write (Name => File_Name, Fmode => Binary);
- end if;
+ File := Open_Read_Write (Name => File_Name, Fmode => Binary);
if File /= Invalid_FD then
if Last_In_Table > 0 then