[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 29 Jan 2014 15:39:03 +0000 (16:39 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 29 Jan 2014 15:39:03 +0000 (16:39 +0100)
2014-01-29  Robert Dewar  <dewar@adacore.com>

* expander.adb: Minor reformatting.

2014-01-29  Javier Miranda  <miranda@adacore.com>

* exp_ch3.adb (Predefined_Primitive_Bodies): Adding documentation to
previous patch.

From-SVN: r207257

gcc/ada/ChangeLog
gcc/ada/exp_ch3.adb
gcc/ada/expander.adb

index 1d0515d3cbfe92ad85c3b143c95f2f3a9d615074..f0b7109dd1d9696e8551254dd7a7bbf34559b1f3 100644 (file)
@@ -1,3 +1,12 @@
+2014-01-29  Robert Dewar  <dewar@adacore.com>
+
+       * expander.adb: Minor reformatting.
+
+2014-01-29  Javier Miranda  <miranda@adacore.com>
+
+       * exp_ch3.adb (Predefined_Primitive_Bodies): Adding documentation to
+       previous patch.
+
 2014-01-29  Javier Miranda  <miranda@adacore.com>
 
        * exp_ch3.adb (Predefined_Primitive_Bodies): Complete the code
index 3dfd39084cd8d69ffbc2c7cbf575a2b6f589905f..4f3846fbd0b4fa5478876c5b0f22768cedbc7e15 100644 (file)
@@ -9632,7 +9632,8 @@ package body Exp_Ch3 is
 
       --  If the parent is an interface type then it has defined all the
       --  predefined primitives abstract and we need to check if the type
-      --  has some user defined "=" function to avoid generating it.
+      --  has some user defined "=" function which matches the profile of
+      --  the Ada predefined equality operator to avoid generating it.
 
       elsif Is_Interface (Etype (Tag_Typ)) then
          Eq_Needed := True;
@@ -9644,7 +9645,8 @@ package body Exp_Ch3 is
               and then not Is_Internal (Node (Prim))
               and then Present (First_Entity (Node (Prim)))
 
-              --  Following tests need a comment ???
+              --  The predefined equality primitive must have exactly two
+              --  formals whose type is this tagged type
 
               and then Present (Last_Entity (Node (Prim)))
               and then Next_Entity (First_Entity (Node (Prim)))
index 6ed3e63d864b9129b6ae371d0b21739ac3985779..9f57cda26a844eeaa2dbe244d2ac8b3c1a04171b 100644 (file)
@@ -57,7 +57,7 @@ package body Expander is
    --  The following table is used to save values of the Expander_Active flag
    --  when they are saved by Expander_Mode_Save_And_Set. We use an extendible
    --  table (which is a bit of overkill) because it is easier than figuring
-   --  out a maximum value or bothering with range checks!
+   --  out a maximum value or bothering with range checks.
 
    package Expander_Flags is new Table.Table (
      Table_Component_Type => Boolean,
@@ -129,13 +129,16 @@ package body Expander is
             --  In GNATprove mode we only need a very limited subset of
             --  the usual expansions. This limited subset is implemented
             --  in Expand_SPARK.
-            --  Regular expansion is followed by special handling for transient
-            --  scopes for unconstrained results, etc. but this is not needed,
-            --  and in general cannot be done correctly, in this mode.
 
             if GNATprove_Mode then
                Expand_SPARK (N);
                Set_Analyzed (N);
+
+               --  Regular expansion is normally followed by special handling
+               --  for transient scopes for unconstrained results, etc. but
+               --  this is not needed, and in general cannot be done correctly,
+               --  in this mode, so we are all done.
+
                return;
 
             --  Here for normal non-SPARK mode