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 e888dab..7e04f40 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 a36fedb..2f3b11b 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 21703d8..91b6725 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 43c27b5..8fc4dfc 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 29ae2ef..f361a9c 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 12fce95..f00c169 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      |