OSDN Git Service

2011-08-04 Yannick Moy <moy@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Aug 2011 13:59:40 +0000 (13:59 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Aug 2011 13:59:40 +0000 (13:59 +0000)
* sem_ch3.adb, sem_ch5.adb, sem_util.adb, sem_ch4.adb, sem_ch8.adb,
opt.ads, lib-xref.ads: Code clean up.

2011-08-04  Yannick Moy  <moy@adacore.com>

* gnat_rm.texi: Update description of Test_Case
* gnat_ugn.texi: Typo.

2011-08-04  Ed Falis  <falis@adacore.com>

* adaint.c (__gnat_get_number_of_cpus): fix typo in last checkin.

2011-08-04  Hristian Kirtchev  <kirtchev@adacore.com>

* exp_ch4.adb (Suitable_Element): Skip field _parent on .NET/JVM when
it is of type Root_Controlled. This action eliminates fields Prev and
Next from type equality.

2011-08-04  Yannick Moy  <moy@adacore.com>

* lib-xref-alfa.adb: Correct typo.

2011-08-04  Matthew Heaney  <heaney@adacore.com>

* a-cohata.ads (Hash_Table_Type): default-initialize the Nodes
component.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177390 138bc75d-0d04-0410-961f-82ee72b054a4

14 files changed:
gcc/ada/ChangeLog
gcc/ada/a-cohata.ads
gcc/ada/adaint.c
gcc/ada/exp_ch4.adb
gcc/ada/gnat_rm.texi
gcc/ada/gnat_ugn.texi
gcc/ada/lib-xref-alfa.adb
gcc/ada/lib-xref.ads
gcc/ada/opt.ads
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch5.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_util.adb

index 01ac7c3..d22593d 100644 (file)
@@ -1,5 +1,34 @@
 2011-08-04  Yannick Moy  <moy@adacore.com>
 
+       * sem_ch3.adb, sem_ch5.adb, sem_util.adb, sem_ch4.adb, sem_ch8.adb,
+       opt.ads, lib-xref.ads: Code clean up.
+
+2011-08-04  Yannick Moy  <moy@adacore.com>
+
+       * gnat_rm.texi: Update description of Test_Case
+       * gnat_ugn.texi: Typo.
+
+2011-08-04  Ed Falis  <falis@adacore.com>
+
+       * adaint.c (__gnat_get_number_of_cpus): fix typo in last checkin.
+
+2011-08-04  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * exp_ch4.adb (Suitable_Element): Skip field _parent on .NET/JVM when
+       it is of type Root_Controlled. This action eliminates fields Prev and
+       Next from type equality.
+
+2011-08-04  Yannick Moy  <moy@adacore.com>
+
+       * lib-xref-alfa.adb: Correct typo.
+
+2011-08-04  Matthew Heaney  <heaney@adacore.com>
+
+       * a-cohata.ads (Hash_Table_Type): default-initialize the Nodes
+       component.
+
+2011-08-04  Yannick Moy  <moy@adacore.com>
+
        * sem_prag.adb (Check_Arg_Is_String_Literal): remove useless procedure
        (Analyze_Pragma): allow static string expression for name of Test_Case,
        instead of simply string literals.
index d935447..2a6c6ab 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2010, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-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- --
@@ -66,7 +66,7 @@ package Ada.Containers.Hash_Tables is
          Busy    : Natural := 0;
          Lock    : Natural := 0;
          Free    : Count_Type'Base := -1;
-         Nodes   : Nodes_Type (1 .. Capacity);
+         Nodes   : Nodes_Type (1 .. Capacity) := (others => <>);
          Buckets : Buckets_Type (1 .. Modulus) := (others => 0);
       end record;
    end Generic_Bounded_Hash_Table_Types;
index a5cc29c..ab8446d 100644 (file)
@@ -2448,7 +2448,7 @@ __gnat_number_of_cpus (void)
   if ((status & 1) != 0)
     cores = res;
 
-#elif defined (__WRS_CONFIG_SMP)
+#elif defined (_WRS_CONFIG_SMP)
   unsigned int vxCpuConfiguredGet (void);
 
   cores = vxCpuConfiguredGet ();
index 0a9ddb1..9acc3e4 100644 (file)
@@ -9328,6 +9328,17 @@ package body Exp_Ch4 is
          elsif Chars (C) = Name_uTag then
             return Suitable_Element (Next_Entity (C));
 
+         --  The .NET/JVM version of type Root_Controlled contains two fields
+         --  which should not be considered part of the object. To achieve
+         --  proper equiality between two controlled objects on .NET/JVM, skip
+         --  field _parent whenever it is of type Root_Controlled.
+
+         elsif Chars (C) = Name_uParent
+           and then VM_Target /= No_VM
+           and then Etype (C) = RTE (RE_Root_Controlled)
+         then
+            return Suitable_Element (Next_Entity (C));
+
          elsif Is_Interface (Etype (C)) then
             return Suitable_Element (Next_Entity (C));
 
index 8c22975..1cfcf71 100644 (file)
@@ -5018,7 +5018,7 @@ Syntax:
 
 @smallexample @c ada
 pragma Test_Case (
-   [Name     =>] String_Expression
+   [Name     =>] static_string_Expression
   ,[Mode     =>] (Normal | Robustness)
  [, Requires =>  Boolean_Expression]
  [, Ensures  =>  Boolean_Expression]);
@@ -5047,7 +5047,7 @@ expression. The following is an example of use within a package spec:
 package Math_Functions is
    ...
    function Sqrt (Arg : Float) return Float;
-   pragma Test_Case (Name     => ``Test_1``,
+   pragma Test_Case (Name     => "Test 1",
                      Mode     => Normal,
                      Requires => Arg < 100,
                      Ensures  => Sqrt'Result < 10);
@@ -5055,6 +5055,15 @@ package Math_Functions is
 end Math_Functions;
 @end smallexample
 
+@noindent
+The meaning of a test case is that, if the associated subprogram is
+executed in a context where @code{Requires} holds, then @code{Ensures}
+should hold when the subprogram returns. Mode @code{Normal} indicates
+that the input context should satisfy the normal precondition of the
+subprogram, and the output context should then satisfy its
+postcondition. More @code{Robustness} indicates that the normal pre- and
+postcondition of the subprogram should be ignored for this test case.
+
 @node Pragma Thread_Local_Storage
 @unnumberedsec Pragma Thread_Local_Storage
 @findex Thread_Local_Storage
index d45a6fc..3e68993 100644 (file)
@@ -17285,7 +17285,7 @@ much has actually been used.
 The environment task stack, e.g., the stack that contains the main unit, is
 only processed when the environment variable GNAT_STACK_LIMIT is set.
 
-@noident
+@noindent
 The package @code{GNAT.Task_Stack_Usage} provides facilities to get
 stack usage reports at run-time. See its body for the details.
 
index 0e0a4ff..9b78b43 100644 (file)
@@ -546,7 +546,7 @@ package body ALFA is
 
          function Is_Global_Constant (E : Entity_Id) return Boolean is
          begin
-            return Ekind (E) in E_Constant
+            return Ekind (E) = E_Constant
               and then Ekind_In (Scope (E), E_Package, E_Package_Body);
          end Is_Global_Constant;
 
index 5ddc273..ecee22a 100644 (file)
@@ -177,7 +177,6 @@ package Lib.Xref is
    --              e = end of spec
    --              H = abstract type
    --              i = implicit reference
-   --              I = object definition with initialization
    --              k = implicit reference to parent unit in child unit
    --              l = label on END line
    --              m = modification
index 3eaa855..ec12136 100644 (file)
@@ -1878,9 +1878,6 @@ package Opt is
    --  the generation of Why code for those parts of the input code that
    --  belong to the ALFA subset of Ada. Set by debuf flag -gnatd.F.
 
-   SPARK_Mode : Boolean := False;
-   --  Reject constructs not allowed by SPARK. Set by flag -gnatd.D.
-
 private
 
    --  The following type is used to save and restore settings of switches in
index 53ba892..4e8ae6d 100644 (file)
@@ -2057,7 +2057,7 @@ package body Sem_Ch3 is
    --  Start of processing for Analyze_Declarations
 
    begin
-      if SPARK_Mode or else Restriction_Check_Required (SPARK) then
+      if Restriction_Check_Required (SPARK) then
          Check_Later_Vs_Basic_Declarations (L, During_Parsing => False);
       end if;
 
index f1b53fc..276c284 100644 (file)
@@ -881,7 +881,7 @@ package body Sem_Ch4 is
    --  Start of processing for Analyze_Call
 
    begin
-      if SPARK_Mode or else Restriction_Check_Required (SPARK) then
+      if Restriction_Check_Required (SPARK) then
          Check_Mixed_Parameter_And_Named_Associations;
       end if;
 
index 3597f79..2e4adcd 100644 (file)
@@ -2620,7 +2620,7 @@ package body Sem_Ch5 is
 
                   --  Now issue the warning (or error in formal mode)
 
-                  if SPARK_Mode or else Restriction_Check_Required (SPARK) then
+                  if Restriction_Check_Required (SPARK) then
                      Check_SPARK_Restriction
                        ("unreachable code is not allowed", Error_Node);
                   else
index 68ba030..9c77001 100644 (file)
@@ -5572,7 +5572,7 @@ package body Sem_Ch8 is
       --  Selector name cannot be a character literal or an operator symbol in
       --  SPARK, except for the operator symbol in a renaming.
 
-      if SPARK_Mode or else Restriction_Check_Required (SPARK) then
+      if Restriction_Check_Required (SPARK) then
          if Nkind (Selector_Name (N)) = N_Character_Literal then
             Check_SPARK_Restriction
               ("character literal cannot be prefixed", N);
@@ -5911,7 +5911,7 @@ package body Sem_Ch8 is
          --  Selector name is restricted in SPARK
 
          if Nkind (N) = N_Expanded_Name
-           and then (SPARK_Mode or else Restriction_Check_Required (SPARK))
+           and then Restriction_Check_Required (SPARK)
          then
             if Is_Subprogram (P_Name) then
                Check_SPARK_Restriction
index 0c36811..b7b8fe0 100644 (file)
@@ -11022,7 +11022,7 @@ package body Sem_Util is
          --  subprogram bodies. Detect those cases by testing whether
          --  Process_End_Label was called for a body (Typ = 't') or a package.
 
-         if (SPARK_Mode or else Restriction_Check_Required (SPARK))
+         if Restriction_Check_Required (SPARK)
            and then (Typ = 't' or else Ekind (Ent) = E_Package)
          then
             Error_Msg_Node_1 := Endl;