aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-load.adb
diff options
context:
space:
mode:
authorPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-09-29 15:33:23 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-09-29 15:33:23 +0000
commitcd644ae2bc0ce62b88f786ce5a68ad0ba2509ec6 (patch)
tree5b626698ecdaf41e2a8f95028be8c76b863eaed6 /gcc/ada/lib-load.adb
parente75210d645630f12bf149043cf6ae51829f5ed78 (diff)
downloadgcc-cd644ae2bc0ce62b88f786ce5a68ad0ba2509ec6.zip
gcc-cd644ae2bc0ce62b88f786ce5a68ad0ba2509ec6.tar.gz
gcc-cd644ae2bc0ce62b88f786ce5a68ad0ba2509ec6.tar.bz2
[multiple changes]
2017-09-29 Bob Duff <duff@adacore.com> * exp_ch6.adb (Expand_Call_Helper): Replace with code more similar to what we had before. (Make_Build_In_Place_Call_In_Object_Declaration): Back out previous change. Set the Etype in the class-wide case. This fixes a regression in the libadalang test suite. 2017-09-29 Joel Brobecker <brobecker@adacore.com> * doc/gnat_ugn/building_executable_programs_with_gnat.rst, doc/gnat_ugn/the_gnat_compilation_model.rst: Avoid use of single colon in comment markup. * gnat_ugn.texi: Regenerate. 2017-09-29 Justin Squirek <squirek@adacore.com> * ali-util.adb, comperr.adb, cprint.adb, errout.adb, fmap.adb, fname-sf.adb, frontend.adb, lib-xref-spark_specific.adb, gnat1drv.adb, gnatls.adb, lib.adb, lib-load.adb, lib-writ.adb, prepcomp.adb, sinput-d.adb, sinput-l.adb, sprint.adb, targparm.adb: Update comparison for checking source file status and error message and/or call to Read_Source_File. * libgnat/s-os_lib.ads: Add new potential value constant for uninitialized file descriptors. * osint.adb, osint.ads (Read_Source_File): Add extra parameter to return result of IO to encompass a read access failure in addition to a file-not-found error. From-SVN: r253294
Diffstat (limited to 'gcc/ada/lib-load.adb')
-rw-r--r--gcc/ada/lib-load.adb28
1 files changed, 21 insertions, 7 deletions
diff --git a/gcc/ada/lib-load.adb b/gcc/ada/lib-load.adb
index f509721..1419422 100644
--- a/gcc/ada/lib-load.adb
+++ b/gcc/ada/lib-load.adb
@@ -122,7 +122,7 @@ package body Lib.Load is
-- No change if we did not find the spec
- if X = No_Source_File then
+ if X <= No_Source_File then
return;
end if;
@@ -326,7 +326,7 @@ package body Lib.Load is
Main_Source_File := Load_Source_File (Fname);
Current_Error_Source_File := Main_Source_File;
- if Main_Source_File /= No_Source_File then
+ if Main_Source_File > No_Source_File then
Version := Source_Checksum (Main_Source_File);
else
-- To avoid emitting a source location (since there is no file),
@@ -334,7 +334,13 @@ package body Lib.Load is
-- in errout.adb.
Set_Standard_Error;
- Write_Str ("file """ & Get_Name_String (Fname) & """ not found");
+ if Main_Source_File = No_Access_To_Source_File then
+ Write_Str ("no read access for file """
+ & Get_Name_String (Fname) & """");
+ else
+ Write_Str ("file """
+ & Get_Name_String (Fname) & """ not found");
+ end if;
Write_Eol;
Set_Standard_Output;
end if;
@@ -716,7 +722,7 @@ package body Lib.Load is
-- File was found
- if Src_Ind /= No_Source_File then
+ if Src_Ind > No_Source_File then
Units.Table (Unum) :=
(Cunit => Empty,
Cunit_Entity => Empty,
@@ -824,7 +830,11 @@ package body Lib.Load is
else
if Debug_Flag_L then
- Write_Str (" file was not found, load failed");
+ if Src_Ind = No_Access_To_Source_File then
+ Write_Str (" no read access to file, load failed");
+ else
+ Write_Str (" file was not found, load failed");
+ end if;
Write_Eol;
end if;
@@ -857,7 +867,11 @@ package body Lib.Load is
else
Error_Msg_File_1 := Fname;
- Error_Msg ("file{ not found", Load_Msg_Sloc);
+ if Src_Ind = No_Access_To_Source_File then
+ Error_Msg ("no read access to file{", Load_Msg_Sloc);
+ else
+ Error_Msg ("file{ not found", Load_Msg_Sloc);
+ end if;
end if;
Write_Dependency_Chain;
@@ -983,7 +997,7 @@ package body Lib.Load is
Unum : constant Unit_Number_Type := Get_Cunit_Unit_Number (U);
Fnum : constant Unit_Number_Type := Get_Cunit_Unit_Number (From);
begin
- if Source_Index (Fnum) /= No_Source_File then
+ if Source_Index (Fnum) > No_Source_File then
Units.Table (Unum).Version :=
Units.Table (Unum).Version
xor