From 2c1a2cf39e016ce795a5cb9801af8098bfa8a234 Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Mon, 29 Aug 2011 08:54:00 +0000 Subject: exp_attr.adb: Minor reformatting. 2011-08-29 Robert Dewar * 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 | 7 +++++++ gcc/ada/checks.adb | 3 ++- gcc/ada/exp_attr.adb | 16 +++++++++++++--- gcc/ada/get_scos.adb | 5 +++++ gcc/ada/par_sco.adb | 5 ++--- gcc/ada/sem_attr.adb | 2 +- 6 files changed, 30 insertions(+), 8 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e888dab..7e04f40 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2011-08-29 Robert Dewar + + * 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 * get_scos.adb: Ignore chaining indicators not currently supported diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index a36fedb..2f3b11b 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -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. diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 21703d8..91b6725 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -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 -- ---------------- diff --git a/gcc/ada/get_scos.adb b/gcc/ada/get_scos.adb index 43c27b5..8fc4dfc 100644 --- a/gcc/ada/get_scos.adb +++ b/gcc/ada/get_scos.adb @@ -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; diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb index 29ae2ef..f361a9c 100644 --- a/gcc/ada/par_sco.adb +++ b/gcc/ada/par_sco.adb @@ -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); diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 12fce95..f00c169 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -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 | -- cgit v1.1