Commit 2c1a2cf3 by Robert Dewar Committed by Arnaud Charlet

exp_attr.adb: Minor reformatting.

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
parent 0bfc9a64
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> 2011-08-29 Thomas Quinot <quinot@adacore.com>
* get_scos.adb: Ignore chaining indicators not currently supported * get_scos.adb: Ignore chaining indicators not currently supported
......
...@@ -2325,7 +2325,8 @@ package body Checks is ...@@ -2325,7 +2325,8 @@ package body Checks is
Target_Type : constant Entity_Id := Etype (N); Target_Type : constant Entity_Id := Etype (N);
Target_Base : constant Entity_Id := Base_Type (Target_Type); Target_Base : constant Entity_Id := Base_Type (Target_Type);
Expr : constant Node_Id := Expression (N); 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 -- Note: if Etype (Expr) is a private type without discriminants, its
-- full view might have discriminants with defaults, so we need the -- full view might have discriminants with defaults, so we need the
-- full view here to retrieve the constraints. -- full view here to retrieve the constraints.
......
...@@ -1814,13 +1814,12 @@ package body Exp_Attr is ...@@ -1814,13 +1814,12 @@ package body Exp_Attr is
-- to this defining identifier. -- to this defining identifier.
when Attribute_Elab_Body | when Attribute_Elab_Body |
Attribute_Elab_Subp_Body |
Attribute_Elab_Spec => Attribute_Elab_Spec =>
-- Leave attribute unexpanded in CodePeer mode: the gnat2scil -- 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; return;
end if; end if;
...@@ -1909,6 +1908,17 @@ package body Exp_Attr is ...@@ -1909,6 +1908,17 @@ package body Exp_Attr is
Rewrite (N, New_Occurrence_Of (Ent, Loc)); Rewrite (N, New_Occurrence_Of (Ent, Loc));
end Elab_Body; 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 -- -- Elaborated --
---------------- ----------------
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
pragma Ada_2005; 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 SCOs; use SCOs;
with Snames; use Snames; with Snames; use Snames;
...@@ -297,12 +300,14 @@ begin ...@@ -297,12 +300,14 @@ begin
exit when Nextc = ':'; exit when Nextc = ':';
N := N + 1; N := N + 1;
end loop; end loop;
begin begin
Pid := Pragma_Id'Value (Buf (1 .. N)); Pid := Pragma_Id'Value (Buf (1 .. N));
exception exception
when Constraint_Error => when Constraint_Error =>
Pid := Unknown_Pragma; Pid := Unknown_Pragma;
end; end;
Skipc; Skipc;
end if; end if;
end if; end if;
......
...@@ -1431,9 +1431,8 @@ package body Par_SCO is ...@@ -1431,9 +1431,8 @@ package body Par_SCO is
-- must generate a P entry for the decision. Note -- must generate a P entry for the decision. Note
-- that this is done unconditionally at this stage. -- that this is done unconditionally at this stage.
-- Output for disabled pragmas is suppressed later -- Output for disabled pragmas is suppressed later
-- on, when we output the decision line in -- on when we output the decision line in Put_SCOs,
-- Put_SCOs, depending on marker sets by -- depending on setting by Set_SCO_Pragma_Enabled.
-- Set_SCO_Pragma_Enabled.
if Nam = Name_Check then if Nam = Name_Check then
Next (Arg); Next (Arg);
......
...@@ -3014,7 +3014,7 @@ package body Sem_Attr is ...@@ -3014,7 +3014,7 @@ package body Sem_Attr is
-- Elab_Body -- -- Elab_Body --
--------------- ---------------
-- Also handles processing for Elab_Spec -- Also handles processing for Elab_Spec and Elab_Subp_Body
when Attribute_Elab_Body | when Attribute_Elab_Body |
Attribute_Elab_Spec | Attribute_Elab_Spec |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment