exp_attr.adb: Minor reformatting.
authorRobert Dewar <dewar@adacore.com>
Mon, 29 Aug 2011 08:54:00 +0000 (08:54 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 08:54:00 +0000 (10:54 +0200)
2011-08-29  Robert Dewar  <dewar@adacore.com>

* exp_attr.adb: Minor reformatting.
Minor code reorganization and commenting.
* par_sco.adb, checks.adb, sem_attr.adb, get_scos.adb: Minor
reformatting.

From-SVN: r178166

gcc/ada/ChangeLog
gcc/ada/checks.adb
gcc/ada/exp_attr.adb
gcc/ada/get_scos.adb
gcc/ada/par_sco.adb
gcc/ada/sem_attr.adb

index e888daba69c47f230a6952a8c1f6a7cc425d2ba8..7e04f4070d6c540a795985ed13fa1023f7c23b06 100644 (file)
@@ -1,3 +1,10 @@
+2011-08-29  Robert Dewar  <dewar@adacore.com>
+
+       * exp_attr.adb: Minor reformatting.
+       Minor code reorganization and commenting.
+       * par_sco.adb, checks.adb, sem_attr.adb, get_scos.adb: Minor
+       reformatting.
+
 2011-08-29  Thomas Quinot  <quinot@adacore.com>
 
        * get_scos.adb: Ignore chaining indicators not currently supported
index a36fedb9e26b7b4688148dcee2a6adbd89fb57ea..2f3b11bfed434928954a5b5fc3ea625563c1afaa 100644 (file)
@@ -2325,7 +2325,8 @@ package body Checks is
       Target_Type : constant Entity_Id := Etype (N);
       Target_Base : constant Entity_Id := Base_Type (Target_Type);
       Expr        : constant Node_Id   := Expression (N);
-      Expr_Type   : constant Entity_Id := Underlying_Type (Etype (Expr));
+
+      Expr_Type : constant Entity_Id := Underlying_Type (Etype (Expr));
       --  Note: if Etype (Expr) is a private type without discriminants, its
       --  full view might have discriminants with defaults, so we need the
       --  full view here to retrieve the constraints.
index 21703d8df6830709d69b30692d25d9cca130f732..91b6725f43bc7ba5bf1e81aa6303f55fd15ec8e2 100644 (file)
@@ -1814,13 +1814,12 @@ package body Exp_Attr is
       --  to this defining identifier.
 
       when Attribute_Elab_Body      |
-           Attribute_Elab_Subp_Body |
            Attribute_Elab_Spec      =>
 
          --  Leave attribute unexpanded in CodePeer mode: the gnat2scil
-         --  back-end knows how to handle this attribute directly.
+         --  back-end knows how to handle these attributes directly.
 
-         if CodePeer_Mode or else Id = Attribute_Elab_Subp_Body then
+         if CodePeer_Mode then
             return;
          end if;
 
@@ -1909,6 +1908,17 @@ package body Exp_Attr is
             Rewrite (N, New_Occurrence_Of (Ent, Loc));
          end Elab_Body;
 
+      --------------------
+      -- Elab_Subp_Body --
+      --------------------
+
+      --  Always ignored. In CodePeer mode, gnat2scil knows how to handle
+      --  this attribute directly, and if we are not in CodePeer mode it is
+      --  entirely ignored ???
+
+      when Attribute_Elab_Subp_Body =>
+         return;
+
       ----------------
       -- Elaborated --
       ----------------
index 43c27b570a74e54e914dfe8a0337374ca5bdf2d3..8fc4dfc651c60b3d7bacfe5f3d396b5ad80933bc 100644 (file)
@@ -24,6 +24,9 @@
 ------------------------------------------------------------------------------
 
 pragma Ada_2005;
+--  This unit is not part of the compiler proper, it is used in tools that
+--  read SCO information from ALI files (Xcov and sco_test). Ada 2005
+--  constructs may therefore be used freely (and are indeed).
 
 with SCOs;   use SCOs;
 with Snames; use Snames;
@@ -297,12 +300,14 @@ begin
                            exit when Nextc = ':';
                            N := N + 1;
                         end loop;
+
                         begin
                            Pid := Pragma_Id'Value (Buf (1 .. N));
                         exception
                            when Constraint_Error =>
                               Pid := Unknown_Pragma;
                         end;
+
                         Skipc;
                      end if;
                   end if;
index 29ae2ef2fa2feb0ca0d4c415f5861357f17b5b05..f361a9cd67f86f6328c97c29e6f0db59dd95ea66 100644 (file)
@@ -1431,9 +1431,8 @@ package body Par_SCO is
                            --  must generate a P entry for the decision. Note
                            --  that this is done unconditionally at this stage.
                            --  Output for disabled pragmas is suppressed later
-                           --  on, when we output the decision line in
-                           --  Put_SCOs, depending on marker sets by
-                           --  Set_SCO_Pragma_Enabled.
+                           --  on when we output the decision line in Put_SCOs,
+                           --  depending on setting by Set_SCO_Pragma_Enabled.
 
                            if Nam = Name_Check then
                               Next (Arg);
index 12fce9508f9a0901f2de9a1e08397584c1fc4a6c..f00c169a96fc5cc2877ccccd87bef9eb41867de9 100644 (file)
@@ -3014,7 +3014,7 @@ package body Sem_Attr is
       -- Elab_Body --
       ---------------
 
-      --  Also handles processing for Elab_Spec
+      --  Also handles processing for Elab_Spec and Elab_Subp_Body
 
       when Attribute_Elab_Body      |
            Attribute_Elab_Spec      |