Commit d6dffa66 by Hristian Kirtchev Committed by Arnaud Charlet

exp_attr.adb, [...]: Minor reformatting.

2015-11-12  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_attr.adb, freeze.adb, sem_util.adb, sem_ch13.adb: Minor
	reformatting.

From-SVN: r230235
parent 73f05f9f
2015-11-12 Hristian Kirtchev <kirtchev@adacore.com>
* exp_attr.adb, freeze.adb, sem_util.adb, sem_ch13.adb: Minor
reformatting.
2015-11-12 Ed Schonberg <schonberg@adacore.com>
* exp_attr.adb (Compile_Stream_Body_In_Scope): When compiling
......
......@@ -634,11 +634,10 @@ package body Exp_Attr is
Arr : Entity_Id;
Check : Boolean)
is
C_Type : constant Entity_Id := Base_Type (Component_Type (Arr));
Curr : constant Entity_Id := Current_Scope;
Install : Boolean := False;
Scop : Entity_Id := Scope (Arr);
C_Type : constant Entity_Id := Base_Type (Component_Type (Arr));
Curr : constant Entity_Id := Current_Scope;
Install : Boolean := False;
Scop : Entity_Id := Scope (Arr);
begin
if Is_Hidden (Arr)
......@@ -646,10 +645,10 @@ package body Exp_Attr is
and then Ekind (Scop) = E_Package
then
Install := True;
else
-- The component type may be private, in which case we install
-- its full view to compile the subprogram.
else
-- The component type may be private, in which case we install its
-- full view to compile the subprogram.
Scop := Scope (C_Type);
......@@ -665,9 +664,7 @@ package body Exp_Attr is
-- If we are within an instance body, then all visibility has been
-- established already and there is no need to install the package.
if Install
and then not In_Instance_Body
then
if Install and then not In_Instance_Body then
Push_Scope (Scop);
Install_Visible_Declarations (Scop);
Install_Private_Declarations (Scop);
......
......@@ -672,24 +672,25 @@ package body Freeze is
-- later for the variable if it is assigned.
if (Ekind (E) = E_Variable
or else (Ekind (E) = E_Constant
and then not Is_Imported (E)))
or else (Ekind (E) = E_Constant
and then not Is_Imported (E)))
and then Overlays_Constant (E)
and then Present (Init)
then
declare
O_Ent : Entity_Id;
Off : Boolean;
begin
Find_Overlaid_Entity (Addr, O_Ent, Off);
if Ekind (O_Ent) = E_Constant
and then Etype (O_Ent) = Typ
and then Present (Constant_Value (O_Ent))
and then Compile_Time_Compare (
Init,
Constant_Value (O_Ent),
Assume_Valid => True) = EQ
and then Compile_Time_Compare
(Init,
Constant_Value (O_Ent),
Assume_Valid => True) = EQ
then
Set_No_Initialization (Decl);
return;
......
......@@ -4725,11 +4725,13 @@ package body Sem_Ch13 is
Find_Overlaid_Entity (N, O_Ent, Off);
if Present (O_Ent) then
-- If the object overlays a constant object, mark it so
if Is_Constant_Object (O_Ent) then
Set_Overlays_Constant (U_Ent);
end if;
else
-- If this is not an overlay, mark a variable as being
-- volatile to prevent unwanted optimizations. It's a
......@@ -4744,9 +4746,9 @@ package body Sem_Ch13 is
end if;
end if;
-- Overlaying controlled objects is erroneous.
-- Emit warning but continue analysis because program is
-- itself legal, and back-end must see address clause.
-- Overlaying controlled objects is erroneous. Emit warning
-- but continue analysis because program is itself legal,
-- and back-end must see address clause.
if Present (O_Ent)
and then (Has_Controlled_Component (Etype (O_Ent))
......
......@@ -16267,6 +16267,7 @@ package body Sem_Util is
Addr : constant Node_Id := Address_Clause (Ent);
O_Ent : Entity_Id;
Off : Boolean;
begin
Find_Overlaid_Entity (Addr, O_Ent, Off);
......
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