lib-writ.adb, [...]: Minor reformatting and code cleanup.
authorHristian Kirtchev <kirtchev@adacore.com>
Thu, 21 Apr 2016 09:41:45 +0000 (09:41 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 21 Apr 2016 09:41:45 +0000 (11:41 +0200)
2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>

* lib-writ.adb, sem_ch6.adb: Minor reformatting and code cleanup.
* sem.adb: Fix comment.

From-SVN: r235325

gcc/ada/ChangeLog
gcc/ada/lib-writ.adb
gcc/ada/sem.adb
gcc/ada/sem_ch6.adb

index 45175a3cd3cbb0b3c53089ec4eb33af3402cb033..73c31eeabe6c96ef04f265e156e9d3e545363e2f 100644 (file)
@@ -1,3 +1,8 @@
+2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * lib-writ.adb, sem_ch6.adb: Minor reformatting and code cleanup.
+       * sem.adb: Fix comment.
+
 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_ch3.adb (Analyze_Subtype_Declaration): A subtype
index 34f3628388a849d1975ae0b0fa5260517394aea2..37f574b0442a59eebd4f79ed2ec8d910f4772e35 100644 (file)
@@ -43,6 +43,7 @@ with Par;
 with Par_SCO;  use Par_SCO;
 with Restrict; use Restrict;
 with Rident;   use Rident;
+with Stand;    use Stand;
 with Scn;      use Scn;
 with Sem_Eval; use Sem_Eval;
 with Sinfo;    use Sinfo;
@@ -155,9 +156,9 @@ package body Lib.Writ is
         OA_Setting        => 'O',
         SPARK_Mode_Pragma => Empty);
 
-      --  Parse system.ads so that the checksum is set right,
-      --  Style checks are not applied. The Ekind is set to ensure
-      --  that this reference is always present in the ali file.
+      --  Parse system.ads so that the checksum is set right. Style checks are
+      --  not applied. The Ekind is set to ensure that this reference is always
+      --  present in the ali file.
 
       declare
          Save_Mindex : constant Nat := Multiple_Unit_Index;
@@ -167,7 +168,8 @@ package body Lib.Writ is
          Style_Check := False;
          Initialize_Scanner (Units.Last, System_Source_File_Index);
          Discard_List (Par (Configuration_Pragmas => False));
-         Set_Ekind (Cunit_Entity (Units.Last),  E_Package);
+         Set_Ekind (Cunit_Entity (Units.Last), E_Package);
+         Set_Scope (Cunit_Entity (Units.Last), Standard_Standard);
          Style_Check := Save_Style;
          Multiple_Unit_Index := Save_Mindex;
       end;
@@ -1435,9 +1437,13 @@ package body Lib.Writ is
             --  context of a unit loaded through a limited_with clause. These
             --  units are never analyzed, and thus the main unit does not
             --  really have a dependency on them.
+            --  Subunits are always compiled in the context of the parent,
+            --  and their file table entries are not properly decorated, they
+            --  are recognized syntactically.
 
             if Present (Cunit_Entity (Unum))
               and then Ekind (Cunit_Entity (Unum)) = E_Void
+              and then Nkind (Unit (Cunit (Unum))) /= N_Subunit
             then
                goto Next_Unit;
             end if;
@@ -1465,9 +1471,9 @@ package body Lib.Writ is
                Write_Info_Char (' ');
                Write_Info_Str (Get_Hex_String (Source_Checksum (Sind)));
 
-               --  If the dependency comes from a limited_with clause,
-               --  record limited_checksum.
-               --  Disable for now, until full checksum changes are checked.
+               --  If the dependency comes from a limited_with clause, record
+               --  limited_checksum. This is disabled until full checksum
+               --  changes are checked.
 
                --  if Present (Cunit_Entity (Unum))
                --    and then From_Limited_With (Cunit_Entity (Unum))
index 345cc0e819f70a0871309e0810fb427091ba2c1f..7ed6a15adf9230c37a6acca0134b3364ade0e767 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2015, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2016, 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- --
@@ -999,7 +999,7 @@ package body Sem is
       if Present (M) then
 
          --  If we are not at the end of the list, then the easiest
-         --  coding is simply to insert before our successor
+         --  coding is simply to insert before our successor.
 
          if Present (Next (N)) then
             Insert_Before_And_Analyze (Next (N), M);
index 0263a4efc61e9120efd86703203986173fe17a6e..1a996da0db8fee3a339f42fa47510ef86776e033 100644 (file)
@@ -3302,7 +3302,7 @@ package body Sem_Ch6 is
 
       --  If we are generating C and this is a function returning a constrained
       --  array type for which we must create a procedure with an extra out
-      --  parameter, build and analyze the body now.  The procedure declaration
+      --  parameter, build and analyze the body now. The procedure declaration
       --  has already been created. We reuse the source body of the function,
       --  because in an instance it may contain global references that cannot
       --  be reanalyzed. The source function itself is not used any further,
@@ -3319,9 +3319,9 @@ package body Sem_Ch6 is
          Rewrite (N, Build_Procedure_Body_Form (Spec_Id, N));
          Analyze (N);
 
-         --  The entity for the created procedure must remain invisible,
-         --  so it does not participate in resolution of subsequent
-         --  references to the function.
+         --  The entity for the created procedure must remain invisible, so it
+         --  does not participate in resolution of subsequent references to the
+         --  function.
 
          Set_Is_Immediately_Visible (Corresponding_Spec (N), False);
          return;