[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 1 Sep 2011 10:59:58 +0000 (12:59 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 1 Sep 2011 10:59:58 +0000 (12:59 +0200)
2011-09-01  Yannick Moy  <moy@adacore.com>

* ali-util.adb, ali-util.ads (Read_Withed_ALIs): Add parameter
Ignore_Errors to ignore failures to read ALI files when True.

2011-09-01  Javier Miranda  <miranda@adacore.com>

* exp_ch3.adb (Expand_N_Object_Declaration): Handle non-default
constructor calls associated with non-tagged record types.

2011-09-01  Robert Dewar  <dewar@adacore.com>

* g-socthi-vms.adb: Minor reformatting.

2011-09-01  Nicolas Roche  <roche@adacore.com>

* sysdep.c: Don't use macro functions for stdio functions on VxWorks
in order to avoid impact of imcompatible changes.
* cstreams.c: Likewise
* cio.c: Likewise
* aux-io.c: Likewise

2011-09-01  Yannick Moy  <moy@adacore.com>

* lib-writ.adb (Write_With_Lines): Always output complete information
on "with" line in Alfa mode, as this is required by formal verification
back-end.

From-SVN: r178406

gcc/ada/ChangeLog
gcc/ada/ali-util.adb
gcc/ada/ali-util.ads
gcc/ada/aux-io.c
gcc/ada/cio.c
gcc/ada/cstreams.c
gcc/ada/exp_ch3.adb
gcc/ada/g-socthi-vms.adb
gcc/ada/lib-writ.adb
gcc/ada/sysdep.c

index a1dd898..dcd69b1 100644 (file)
@@ -1,3 +1,31 @@
+2011-09-01  Yannick Moy  <moy@adacore.com>
+
+       * ali-util.adb, ali-util.ads (Read_Withed_ALIs): Add parameter
+       Ignore_Errors to ignore failures to read ALI files when True.
+
+2011-09-01  Javier Miranda  <miranda@adacore.com>
+
+       * exp_ch3.adb (Expand_N_Object_Declaration): Handle non-default
+       constructor calls associated with non-tagged record types.
+
+2011-09-01  Robert Dewar  <dewar@adacore.com>
+
+       * g-socthi-vms.adb: Minor reformatting.
+
+2011-09-01  Nicolas Roche  <roche@adacore.com>
+
+       * sysdep.c: Don't use macro functions for stdio functions on VxWorks
+       in order to avoid impact of imcompatible changes.
+       * cstreams.c: Likewise
+       * cio.c: Likewise
+       * aux-io.c: Likewise
+
+2011-09-01  Yannick Moy  <moy@adacore.com>
+
+       * lib-writ.adb (Write_With_Lines): Always output complete information
+       on "with" line in Alfa mode, as this is required by formal verification
+       back-end.
+
 2011-09-01  Tristan Gingold  <gingold@adacore.com>
 
        * g-socthi-vms.adb: Add comments.
index a040d30..0b43200 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2010, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2011, 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- --
@@ -212,7 +212,10 @@ package body ALI.Util is
    -- Read_Withed_ALIs --
    ----------------------
 
-   procedure Read_Withed_ALIs (Id : ALI_Id) is
+   procedure Read_Withed_ALIs
+     (Id            : ALI_Id;
+      Ignore_Errors : Boolean := False)
+   is
       Afile  : File_Name_Type;
       Text   : Text_Buffer_Ptr;
       Idread : ALI_Id;
@@ -234,59 +237,67 @@ package body ALI.Util is
             then
                Text := Read_Library_Info (Afile);
 
-               --  Return with an error if source cannot be found. We used to
-               --  skip this check when we did not compile library generics
-               --  separately, but we now always do, so there is no special
-               --  case here anymore.
+               --  Unless Ignore_Errors is true, return with an error if source
+               --  cannot be found. We used to skip this check when we did not
+               --  compile library generics separately, but we now always do,
+               --  so there is no special case here anymore.
 
                if Text = null then
-                  Error_Msg_File_1 := Afile;
-                  Error_Msg_File_2 := Withs.Table (W).Sfile;
-                  Error_Msg ("{ not found, { must be compiled");
-                  Set_Name_Table_Info (Afile, Int (No_Unit_Id));
-                  return;
-               end if;
-
-               --  Enter in ALIs table
 
-               Idread :=
-                 Scan_ALI
-                   (F         => Afile,
-                    T         => Text,
-                    Ignore_ED => False,
-                    Err       => False);
-
-               Free (Text);
-
-               if ALIs.Table (Idread).Compile_Errors then
-                  Error_Msg_File_1 := Withs.Table (W).Sfile;
-                  Error_Msg ("{ had errors, must be fixed, and recompiled");
-                  Set_Name_Table_Info (Afile, Int (No_Unit_Id));
+                  if not Ignore_Errors then
+                     Error_Msg_File_1 := Afile;
+                     Error_Msg_File_2 := Withs.Table (W).Sfile;
+                     Error_Msg ("{ not found, { must be compiled");
+                     Set_Name_Table_Info (Afile, Int (No_Unit_Id));
+                     return;
+                  end if;
 
-               elsif ALIs.Table (Idread).No_Object then
-                  Error_Msg_File_1 := Withs.Table (W).Sfile;
-                  Error_Msg ("{ must be recompiled");
-                  Set_Name_Table_Info (Afile, Int (No_Unit_Id));
-               end if;
+               else
+                  --  Enter in ALIs table
+
+                  Idread :=
+                    Scan_ALI
+                      (F         => Afile,
+                       T         => Text,
+                       Ignore_ED => False,
+                       Err       => False);
+
+                  Free (Text);
+
+                  if ALIs.Table (Idread).Compile_Errors
+                    and then not Ignore_Errors
+                  then
+                     Error_Msg_File_1 := Withs.Table (W).Sfile;
+                     Error_Msg ("{ had errors, must be fixed, and recompiled");
+                     Set_Name_Table_Info (Afile, Int (No_Unit_Id));
+
+                  elsif ALIs.Table (Idread).No_Object
+                    and then not Ignore_Errors
+                  then
+                     Error_Msg_File_1 := Withs.Table (W).Sfile;
+                     Error_Msg ("{ must be recompiled");
+                     Set_Name_Table_Info (Afile, Int (No_Unit_Id));
+                  end if;
 
-               --  If the Unit is an Interface to a Stand-Alone Library,
-               --  set the Interface flag in the Withs table, so that its
-               --  dependant are not considered for elaboration order.
+                  --  If the Unit is an Interface to a Stand-Alone Library,
+                  --  set the Interface flag in the Withs table, so that its
+                  --  dependant are not considered for elaboration order.
 
-               if ALIs.Table (Idread).SAL_Interface then
-                  Withs.Table (W).SAL_Interface  := True;
-                  Interface_Library_Unit := True;
+                  if ALIs.Table (Idread).SAL_Interface then
+                     Withs.Table (W).SAL_Interface := True;
+                     Interface_Library_Unit := True;
 
-                  --  Set the entry in the Interfaces hash table, so that other
-                  --  units that import this unit will set the flag in their
-                  --  entry in the Withs table.
+                     --  Set the entry in the Interfaces hash table, so that
+                     --  other units that import this unit will set the flag
+                     --  in their entry in the Withs table.
 
-                  Interfaces.Set (Afile, True);
+                     Interfaces.Set (Afile, True);
 
-               else
-                  --  Otherwise, recurse to get new dependents
+                  else
+                     --  Otherwise, recurse to get new dependents
 
-                  Read_Withed_ALIs (Idread);
+                     Read_Withed_ALIs (Idread);
+                  end if;
                end if;
 
             --  If the ALI file has already been processed and is an interface,
index cbdb14f..707fec7 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2010, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2011, 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- --
@@ -100,11 +100,15 @@ package ALI.Util is
    -- Subprograms for Manipulating ALI Information --
    --------------------------------------------------
 
-   procedure Read_Withed_ALIs (Id : ALI_Id);
+   procedure Read_Withed_ALIs
+     (Id            : ALI_Id;
+      Ignore_Errors : Boolean := False);
    --  Process an ALI file which has been read and scanned by looping through
    --  all withed units in the ALI file, checking if they have been processed.
    --  Each unit that has not yet been processed will be read, scanned, and
-   --  processed recursively.
+   --  processed recursively. If Ignore_Errors is True, then failure to read an
+   --  ALI file is not reported as an error, and scanning continues with other
+   --  ALI files.
 
    procedure Set_Source_Table (A : ALI_Id);
    --  Build source table entry corresponding to the ALI file whose id is A
index a7ab20b..6ff415d 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *           Copyright (C) 1992-2009 Free Software Foundation, Inc.         *
+ *           Copyright (C) 1992-2011, 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- *
 #include "system.h"
 #endif
 
+/* Don't use macros versions of this functions on VxWorks since they cause
+   imcompatible changes in some VxWorks versions */
+#ifdef __vxworks
+#undef getchar
+#undef putchar
+#undef feof
+#undef ferror
+#undef fileno
+#endif
+
 /* Function wrappers are needed to access the values from Ada which are
    defined as C macros.  */
 
index 73e5427..2564e4d 100644 (file)
@@ -54,9 +54,14 @@ extern "C" {
 #undef stdout
 #endif
 
-#ifdef VTHREADS
-#undef putchar
+/* Don't use macros versions of this functions on VxWorks since they cause
+   imcompatible changes in some VxWorks versions */
+#ifdef __vxworks
 #undef getchar
+#undef putchar
+#undef feof
+#undef ferror
+#undef fileno
 #endif
 
 #ifdef RTX
index 3477cf4..9b2e9b2 100644 (file)
@@ -70,6 +70,16 @@ extern "C" {
 
 #endif
 
+/* Don't use macros versions of this functions on VxWorks since they cause
+   imcompatible changes in some VxWorks versions */
+#ifdef __vxworks
+#undef getchar
+#undef putchar
+#undef feof
+#undef ferror
+#undef fileno
+#endif
+
 /* The _IONBF value in MINGW32 stdio.h is wrong.  */
 #if defined (WINNT) || defined (_WINNT)
 #if OLD_MINGW
index 338dad1..464fdef 100644 (file)
@@ -5129,9 +5129,13 @@ package body Exp_Ch3 is
                              Loc))));
                end;
 
-            elsif Is_Tagged_Type (Typ)
-              and then Is_CPP_Constructor_Call (Expr)
-            then
+            --  Handle C++ constructor calls. Note that we do not check that
+            --  Typ is a tagged type since the equivalent Ada type of a C++
+            --  class that has no virtual methods is a non-tagged limited
+            --  record type.
+
+            elsif Is_CPP_Constructor_Call (Expr) then
+
                --  The call to the initialization procedure does NOT freeze the
                --  object being initialized.
 
index 6addd56..c075ae5 100644 (file)
@@ -41,9 +41,8 @@ package body GNAT.Sockets.Thin is
    type VMS_Msghdr is new Msghdr;
    pragma Pack (VMS_Msghdr);
    --  On VMS 8.x (unlike other platforms), struct msghdr is packed, so a
-   --  specific derived type is required.
-   --  This structure was not packed on VMS 7.3, so sendmsg and recvmsg fail on
-   --  earlier VMS versions.
+   --  specific derived type is required. This structure was not packed on
+   --  VMS 7.3, so sendmsg and recvmsg fail on earlier VMS versions.
 
    Non_Blocking_Sockets : aliased Fd_Set;
    --  When this package is initialized with Process_Blocking_IO set to True,
index bd236ea..c8129e9 100644 (file)
@@ -796,6 +796,12 @@ package body Lib.Writ is
                       or else
                      Nkind (Unit (Cunit)) in N_Generic_Renaming_Declaration)
                     and then Generic_May_Lack_ALI (Fname))
+
+              --  In Alfa mode, always generate the dependencies on ALI
+              --  files, which are required to compute frame conditions
+              --  of subprograms.
+
+              or else Alfa_Mode
             then
                Write_Info_Tab (25);
 
index aee200a..af05a91 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *         Copyright (C) 1992-2010, Free Software Foundation, Inc.          *
+ *         Copyright (C) 1992-2011, 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- *
@@ -69,6 +69,16 @@ extern struct tm *localtime_r(const time_t *, struct tm *);
 
 #include "adaint.h"
 
+/* Don't use macros versions of this functions on VxWorks since they cause
+   imcompatible changes in some VxWorks versions */
+#ifdef __vxworks
+#undef getchar
+#undef putchar
+#undef feof
+#undef ferror
+#undef fileno
+#endif
+
 /*
    mode_read_text
    open text file for reading