aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-load.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/lib-load.adb')
-rw-r--r--gcc/ada/lib-load.adb86
1 files changed, 44 insertions, 42 deletions
diff --git a/gcc/ada/lib-load.adb b/gcc/ada/lib-load.adb
index f8d632a..737762c 100644
--- a/gcc/ada/lib-load.adb
+++ b/gcc/ada/lib-load.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2021, 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- --
@@ -23,27 +23,30 @@
-- --
------------------------------------------------------------------------------
-with Atree; use Atree;
-with Debug; use Debug;
-with Einfo; use Einfo;
-with Errout; use Errout;
-with Fname; use Fname;
-with Fname.UF; use Fname.UF;
-with Nlists; use Nlists;
-with Nmake; use Nmake;
-with Opt; use Opt;
-with Osint; use Osint;
-with Osint.C; use Osint.C;
-with Output; use Output;
+with Atree; use Atree;
+with Debug; use Debug;
+with Einfo; use Einfo;
+with Einfo.Entities; use Einfo.Entities;
+with Errout; use Errout;
+with Fname; use Fname;
+with Fname.UF; use Fname.UF;
+with Nlists; use Nlists;
+with Nmake; use Nmake;
+with Opt; use Opt;
+with Osint; use Osint;
+with Osint.C; use Osint.C;
+with Output; use Output;
with Par;
-with Restrict; use Restrict;
-with Scn; use Scn;
-with Sinfo; use Sinfo;
-with Sinput; use Sinput;
-with Sinput.L; use Sinput.L;
-with Stand; use Stand;
-with Tbuild; use Tbuild;
-with Uname; use Uname;
+with Restrict; use Restrict;
+with Scn; use Scn;
+with Sinfo; use Sinfo;
+with Sinfo.Nodes; use Sinfo.Nodes;
+with Sinfo.Utils; use Sinfo.Utils;
+with Sinput; use Sinput;
+with Sinput.L; use Sinput.L;
+with Stand; use Stand;
+with Tbuild; use Tbuild;
+with Uname; use Uname;
package body Lib.Load is
@@ -85,7 +88,7 @@ package body Lib.Load is
-- Note: for the following we should really generalize and consult the
-- file name pattern data, but for now we just deal with the common
- -- naming cases, which is probably good enough in practice ???
+ -- naming cases, which is good enough in practice.
-- Change .adb to .ads
@@ -361,7 +364,7 @@ package body Lib.Load is
Error_Location => No_Location,
Expected_Unit => No_Unit_Name,
Fatal_Error => None,
- Generate_Code => False,
+ Generate_Code => True,
Has_RACW => False,
Filler => False,
Ident_String => Empty,
@@ -393,14 +396,14 @@ package body Lib.Load is
---------------
function Load_Unit
- (Load_Name : Unit_Name_Type;
- Required : Boolean;
- Error_Node : Node_Id;
- Subunit : Boolean;
- Corr_Body : Unit_Number_Type := No_Unit;
- Renamings : Boolean := False;
- With_Node : Node_Id := Empty;
- PMES : Boolean := False) return Unit_Number_Type
+ (Load_Name : Unit_Name_Type;
+ Required : Boolean;
+ Error_Node : Node_Id;
+ Subunit : Boolean;
+ Corr_Body : Unit_Number_Type := No_Unit;
+ Renamings : Boolean := False;
+ With_Node : Node_Id := Empty;
+ PMES : Boolean := False) return Unit_Number_Type
is
Calling_Unit : Unit_Number_Type;
Uname_Actual : Unit_Name_Type;
@@ -424,7 +427,7 @@ package body Lib.Load is
-- it is part of the main extended source, otherwise reset them.
-- Note: it's a bit odd but PMES is False for subunits, which is why
- -- we have the OR here. Should be investigated some time???
+ -- we have the OR here.
if PMES or Subunit then
Restore_Config_Cunit_Boolean_Restrictions;
@@ -448,8 +451,8 @@ package body Lib.Load is
With_Node => With_Node);
if Unump = No_Unit then
- Parsing_Main_Extended_Source := Save_PMES;
- return No_Unit;
+ Unum := No_Unit;
+ goto Done;
end if;
-- If parent is a renaming, then we use the renamed package as
@@ -478,7 +481,7 @@ package body Lib.Load is
-- installing the context. The implicit with is on this entity,
-- not on the package it renames. This is somewhat redundant given
-- the with_clause just created, but it simplifies subsequent
- -- expansion of the current with_clause. Optimizable ???
+ -- expansion of the current with_clause.
if Nkind (Error_Node) = N_With_Clause
and then Nkind (Name (Error_Node)) = N_Selected_Component
@@ -820,7 +823,7 @@ package body Lib.Load is
Units.Table (Calling_Unit).Fatal_Error := Error_Detected;
-- If with'ed unit had an ignored error, then propagate it
- -- but do not overide an existring setting.
+ -- but do not overide an existing setting.
when Error_Ignored =>
if Units.Table (Calling_Unit).Fatal_Error = None then
@@ -897,7 +900,7 @@ package body Lib.Load is
Remove_Unit (Unum);
-- If unit not required, remove load stack entry and the junk
- -- file table entry, and return No_Unit to indicate not found,
+ -- file table entry, and return No_Unit to indicate not found.
else
Load_Stack.Decrement_Last;
@@ -961,13 +964,12 @@ package body Lib.Load is
Units.Increment_Last;
if In_Main then
- Units.Table (Units.Last) := Units.Table (Main_Unit);
- Units.Table (Units.Last).Cunit := Library_Unit (N);
- Units.Table (Units.Last).Generate_Code := True;
+ Units.Table (Units.Last) := Units.Table (Main_Unit);
+ Units.Table (Units.Last).Cunit := Library_Unit (N);
Init_Unit_Name (Units.Last, Unit_Name (Main_Unit));
- Units.Table (Main_Unit).Cunit := N;
- Units.Table (Main_Unit).Version := Source_Checksum (Sind);
+ Units.Table (Main_Unit).Cunit := N;
+ Units.Table (Main_Unit).Version := Source_Checksum (Sind);
Init_Unit_Name (Main_Unit,
Get_Body_Name
(Unit_Name (Get_Cunit_Unit_Number (Library_Unit (N)))));