[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 19 Mar 2012 16:27:18 +0000 (17:27 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 19 Mar 2012 16:27:18 +0000 (17:27 +0100)
2012-03-19  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch4.adb (Analyze_Allocator): Detect an allocator generated
by the build-in-place machinery where the designated type is
indefinite, but the underlying type is not. Do not emit errors
related to missing initialization in this case.

2012-03-19  Robert Dewar  <dewar@adacore.com>

* gnat_ugn.texi: Add documentation for -gnateinnn switch.
* sem_elab.adb, put_alfa.adb, lib-xref-alfa.adb: Minor reformatting.
* sem_prag.adb: Minor comment update.

From-SVN: r185525

gcc/ada/ChangeLog
gcc/ada/gnat_ugn.texi
gcc/ada/lib-xref-alfa.adb
gcc/ada/put_alfa.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_elab.adb
gcc/ada/sem_prag.adb

index 9fa56eb335b0e6b3149d838796c28c7c3e8789d3..956ff44e759de9dc17a9567ec47f5b08b1b85757 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-19  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_ch4.adb (Analyze_Allocator): Detect an allocator generated
+       by the build-in-place machinery where the designated type is
+       indefinite, but the underlying type is not. Do not emit errors
+       related to missing initialization in this case.
+
+2012-03-19  Robert Dewar  <dewar@adacore.com>
+
+       * gnat_ugn.texi: Add documentation for -gnateinnn switch.
+       * sem_elab.adb, put_alfa.adb, lib-xref-alfa.adb: Minor reformatting.
+       * sem_prag.adb: Minor comment update.
+
 2012-03-15  Robert Dewar  <dewar@adacore.com>
 
        * errout.ads: Add entry for translating -gnateinn to
index 365a4478a1dcfa4b6315b86322051f262708d504..b8539f03d4746b2e2dd6cdc2abbc58735a2407af 100644 (file)
@@ -4155,6 +4155,12 @@ Display full source path name in brief error messages.
 @cindex @option{-gnateG} (@command{gcc})
 Save result of preprocessing in a text file.
 
+@item ^-gnatei^/MAX_INSTANTIATIONS=^@var{nnn}
+@cindex @option{-gnatei} (@command{gcc})
+Set maximum number of instantiations during compilation of a single unit to
+@var{nnn}. This may be useful in increasing the default maximum of 8000 for
+the rare case when a single unit legitimately exceeds this limit.
+
 @item ^-gnateI^/MULTI_UNIT_INDEX=^@var{nnn}
 @cindex @option{-gnateI} (@command{gcc})
 Indicates that the source is a multi-unit source and that the index of the
index c1c6b25ca9c95af8a1476a23824db9a3a809ede2..4961fedc8c11d03b46bc8dc28a29a20d38830d7f 100644 (file)
@@ -211,10 +211,10 @@ package body Alfa is
 
    procedure Add_Alfa_File (U : Unit_Number_Type; D : Nat) is
       From : Scope_Index;
+      S    : constant Source_File_Index := Source_Index (U);
 
-      S : constant Source_File_Index := Source_Index (U);
-
-      File_Name, Unit_File_Name : String_Ptr;
+      File_Name      : String_Ptr;
+      Unit_File_Name : String_Ptr;
 
    begin
       --  Source file could be inexistant as a result of an error, if option
index a5580a8018c0b264056e8ba2f40ba014a6a73602..f4715bfdd84ec168affa36f035f5f8f27095fc52 100644 (file)
@@ -56,6 +56,7 @@ begin
             Write_Info_Char ('-');
             Write_Info_Char ('>');
             Write_Info_Char (' ');
+
             for N in F.Unit_File_Name'Range loop
                Write_Info_Char (F.Unit_File_Name (N));
             end loop;
index ffc3a271c63824a25a48303237964f1819a3955e..d56da36f3fa2a89eb12465aa92d705a20e47e9a8 100644 (file)
@@ -661,9 +661,22 @@ package body Sem_Ch4 is
             if Is_Indefinite_Subtype (Type_Id)
               and then Serious_Errors_Detected = Sav_Errs
             then
-               if Is_Class_Wide_Type (Type_Id) then
+               --  The build-in-place machinery may produce an allocator when
+               --  the designated type is indefinite but the underlying type is
+               --  not. In this case the unknown discriminants are meaningless
+               --  and should not trigger error messages. Check the parent node
+               --  because the allocator is marked as coming from source.
+
+               if Present (Underlying_Type (Type_Id))
+                 and then not Is_Indefinite_Subtype (Underlying_Type (Type_Id))
+                 and then not Comes_From_Source (Parent (N))
+               then
+                  null;
+
+               elsif Is_Class_Wide_Type (Type_Id) then
                   Error_Msg_N
                     ("initialization required in class-wide allocation", N);
+
                else
                   if Ada_Version < Ada_2005
                     and then Is_Limited_Type (Type_Id)
index 2656f46de5b181d2d49cdf80acccab119a4615d8..4f28e1eb1d78c8b285eca1646a7c442805c36724 100644 (file)
@@ -2620,13 +2620,10 @@ package body Sem_Elab is
 
       if No (Nam) then
          return Empty;
-
       elsif Nkind (Nam) = N_Selected_Component then
          return Entity (Selector_Name (Nam));
-
       elsif not Is_Entity_Name (Nam) then
          return Empty;
-
       else
          return Entity (Nam);
       end if;
index d55325a272fc74bf72ba17e8103d8c763cd8b34b..1cd35904a20d4e5e1175897b49eb7a99246fb0ef 100644 (file)
@@ -3704,7 +3704,7 @@ package body Sem_Prag is
          Check_At_Most_N_Arguments (1);
 
          --  Modeled internally as
-         --    pragma Unsuppress (Atomic_Synchronization [,Entity])
+         --    pragma Suppress/Unsuppress (Atomic_Synchronization [,Entity])
 
          Rewrite (N,
            Make_Pragma (Loc,