summaryrefslogtreecommitdiff
path: root/gcc/ada/rtsfind.adb
diff options
context:
space:
mode:
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-12 00:21:40 +0000
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-12 00:21:40 +0000
commita7b4d0777f64ffceedfc656aab24815db3406891 (patch)
tree0f89902e80ebe7075531f1ea0945930034fb97aa /gcc/ada/rtsfind.adb
parent59c93cd996e0ac582348d0fd3620e01c70f12326 (diff)
downloadgcc-a7b4d0777f64ffceedfc656aab24815db3406891.tar.gz
* restrict.adb (Disallow in No_Run_Time_Mode): Properly specialize
the error message for high integrity mode. * rtsfind.adb (RTE): Give message if we try to find an entity that is not available in high integrity mode. * rtsfind.ads: (OK_To_Use_In_HIE_Mode): New array. (RTE): May return Empty in high integrity mode. * rtsfind.ads (OK_To_Use_In_No_Run_Time_Mode): New name for OK_To_Use_In_HIE_Mode, now includes System_FAT_xxx. * sem_ch6.adb (Analyze_Subprogram_Body): Kill body in predefined unit if not inlined always and in no runtime mode. Fixes problem caused by new Rtsfind changes. * sem_ch6.adb (Analyze_Subrogram_Body): Do not Check_References if body is deleted. * rtsfind.adb (RTE): Make sure we do not try to load unit after giving message for entity not available in high integrity mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46214 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/rtsfind.adb')
-rw-r--r--gcc/ada/rtsfind.adb88
1 files changed, 53 insertions, 35 deletions
diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb
index 1299e1e2a13..08b6e5e2a18 100644
--- a/gcc/ada/rtsfind.adb
+++ b/gcc/ada/rtsfind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- $Revision: 1.96 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- --
@@ -26,30 +26,30 @@
-- --
------------------------------------------------------------------------------
-with Atree; use Atree;
-with Casing; use Casing;
-with Csets; use Csets;
-with Debug; use Debug;
-with Einfo; use Einfo;
-with Elists; use Elists;
-with Fname; use Fname;
-with Fname.UF; use Fname.UF;
-with Lib; use Lib;
-with Lib.Load; use Lib.Load;
-with Namet; use Namet;
-with Nlists; use Nlists;
-with Nmake; use Nmake;
-with Output; use Output;
-with Opt; use Opt;
-with Restrict; use Restrict;
-with Sem; use Sem;
-with Sem_Ch7; use Sem_Ch7;
-with Sem_Util; use Sem_Util;
-with Sinfo; use Sinfo;
-with Stand; use Stand;
-with Snames; use Snames;
-with Tbuild; use Tbuild;
-with Uname; use Uname;
+with Atree; use Atree;
+with Casing; use Casing;
+with Csets; use Csets;
+with Debug; use Debug;
+with Einfo; use Einfo;
+with Elists; use Elists;
+with Fname; use Fname;
+with Fname.UF; use Fname.UF;
+with Lib; use Lib;
+with Lib.Load; use Lib.Load;
+with Namet; use Namet;
+with Nlists; use Nlists;
+with Nmake; use Nmake;
+with Output; use Output;
+with Opt; use Opt;
+with Restrict; use Restrict;
+with Sem; use Sem;
+with Sem_Ch7; use Sem_Ch7;
+with Sem_Util; use Sem_Util;
+with Sinfo; use Sinfo;
+with Stand; use Stand;
+with Snames; use Snames;
+with Tbuild; use Tbuild;
+with Uname; use Uname;
package body Rtsfind is
@@ -581,7 +581,6 @@ package body Rtsfind is
Lib_Unit : Node_Id;
Pkg_Ent : Entity_Id;
Ename : Name_Id;
- Enode : Node_Id;
procedure Check_RPC;
-- Reject programs that make use of distribution features not supported
@@ -713,6 +712,15 @@ package body Rtsfind is
-- Start of processing for RTE
begin
+ -- Check violation of no run time mode
+
+ if No_Run_Time
+ and then not OK_To_Use_In_No_Run_Time_Mode (U_Id)
+ then
+ Disallow_In_No_Run_Time_Mode (Current_Error_Node);
+ return Empty;
+ end if;
+
-- Doing a rtsfind in system.ads is special, as we cannot do this
-- when compiling System itself. So if we are compiling system then
-- we should already have acquired and processed the declaration
@@ -731,8 +739,6 @@ package body Rtsfind is
return Find_Local_Entity (E);
end if;
- Enode := Current_Error_Node;
-
-- Load unit if unit not previously loaded
if No (RE_Table (E)) then
@@ -769,10 +775,21 @@ package body Rtsfind is
Next_Entity (Pkg_Ent);
end loop;
- -- If we didn't find the unit we want, something is wrong!
+ -- If we didn't find the unit we want, something is wrong
+ -- although in no run time mode, we already gave a suitable
+ -- message, and so we simply return Empty, and the caller must
+ -- be prepared to handle this if the RTE call is otherwise
+ -- possible in high integrity mode.
+
+ if No_Run_Time
+ and then not OK_To_Use_In_No_Run_Time_Mode (U_Id)
+ then
+ return Empty;
- Load_Fail ("entity not in package", U_Id, RE_Id'Image (E));
- raise Program_Error;
+ else
+ Load_Fail ("entity not in package", U_Id, RE_Id'Image (E));
+ raise Program_Error;
+ end if;
end if;
end if;
@@ -809,7 +826,7 @@ package body Rtsfind is
end;
end if;
- -- We can now obtain the entity. Check that the No_Run_Time condition
+ -- We can now obtain the entity. Check that the no run time condition
-- is not violated. Note that we do not signal the error if we detect
-- it in a runtime unit. This can only arise if the user explicitly
-- with'ed the runtime unit (or another runtime unit that uses it
@@ -822,11 +839,12 @@ package body Rtsfind is
if Is_Subprogram (Ent)
and then not Is_Inlined (Ent)
- and then Sloc (Enode) /= Standard_Location
+ and then Sloc (Current_Error_Node) /= Standard_Location
and then not
- Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Enode)))
+ Is_Predefined_File_Name
+ (Unit_File_Name (Get_Source_Unit (Current_Error_Node)))
then
- Disallow_In_No_Run_Time_Mode (Enode);
+ Disallow_In_No_Run_Time_Mode (Current_Error_Node);
end if;
return Ent;