Commit 79859568 by Arnaud Charlet

[multiple changes]

2014-08-01  Hristian Kirtchev  <kirtchev@adacore.com>

	* einfo.adb (Is_Hidden_Non_Overridden_Subprogram): Remove the
	assertion check as the attribute is defined for all entities.
	(Set_Is_Hidden_Non_Overridden_Subprogram): Remove the assertion
	check as the attribute is defined for all entities.
	* einfo.ads Update the documentation of attribute
	Is_Hidden_Non_Overridden_Subprogram.
	* sem_ch7.adb (Install_Package_Entity): No need to check the
	entity kind of the Id.
	* sem_ch13.adb (Hide_Matching_Homograph): Update the comment on
	usage. Ensure that the homographs are of the same entity kind
	and not fully conformant.
	(Hide_Non_Overridden_Subprograms): Update the comment on usage.

2014-08-01  Robert Dewar  <dewar@adacore.com>

	* inline.adb: Minor code reorganization.
	* sem_ch12.adb, s-tasdeb.ads: Minor reformatting.

From-SVN: r213445
parent 3fe5cead
2014-08-01 Hristian Kirtchev <kirtchev@adacore.com>
* einfo.adb (Is_Hidden_Non_Overridden_Subprogram): Remove the
assertion check as the attribute is defined for all entities.
(Set_Is_Hidden_Non_Overridden_Subprogram): Remove the assertion
check as the attribute is defined for all entities.
* einfo.ads Update the documentation of attribute
Is_Hidden_Non_Overridden_Subprogram.
* sem_ch7.adb (Install_Package_Entity): No need to check the
entity kind of the Id.
* sem_ch13.adb (Hide_Matching_Homograph): Update the comment on
usage. Ensure that the homographs are of the same entity kind
and not fully conformant.
(Hide_Non_Overridden_Subprograms): Update the comment on usage.
2014-08-01 Robert Dewar <dewar@adacore.com>
* inline.adb: Minor code reorganization.
* sem_ch12.adb, s-tasdeb.ads: Minor reformatting.
2014-08-01 Robert Dewar <dewar@adacore.com> 2014-08-01 Robert Dewar <dewar@adacore.com>
* inline.adb, s-os_lib.ads: Minor reformatting. * inline.adb, s-os_lib.ads: Minor reformatting.
......
...@@ -2068,7 +2068,6 @@ package body Einfo is ...@@ -2068,7 +2068,6 @@ package body Einfo is
function Is_Hidden_Non_Overridden_Subprogram (Id : E) return B is function Is_Hidden_Non_Overridden_Subprogram (Id : E) return B is
begin begin
pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
return Flag2 (Id); return Flag2 (Id);
end Is_Hidden_Non_Overridden_Subprogram; end Is_Hidden_Non_Overridden_Subprogram;
...@@ -4850,7 +4849,6 @@ package body Einfo is ...@@ -4850,7 +4849,6 @@ package body Einfo is
procedure Set_Is_Hidden_Non_Overridden_Subprogram (Id : E; V : B := True) is procedure Set_Is_Hidden_Non_Overridden_Subprogram (Id : E; V : B := True) is
begin begin
pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
Set_Flag2 (Id, V); Set_Flag2 (Id, V);
end Set_Is_Hidden_Non_Overridden_Subprogram; end Set_Is_Hidden_Non_Overridden_Subprogram;
......
...@@ -2423,9 +2423,9 @@ package Einfo is ...@@ -2423,9 +2423,9 @@ package Einfo is
-- Private_Declaration in sem_ch7). -- Private_Declaration in sem_ch7).
-- Is_Hidden_Non_Overridden_Subprogram (Flag2) -- Is_Hidden_Non_Overridden_Subprogram (Flag2)
-- Defined in all entities. Set for implicitly declared non-generic -- Defined in all entities. Set for implicitly declared subprograms
-- subprograms that require overriding or are null procedures, and are -- that require overriding or are null procedures, and are hidden by
-- hidden by a non-conformant homograph with the same characteristics -- a non-fully conformant homograph with the same characteristics
-- (Ada RM 8.3 12.3/2). -- (Ada RM 8.3 12.3/2).
-- Is_Hidden_Open_Scope (Flag171) -- Is_Hidden_Open_Scope (Flag171)
......
...@@ -1239,11 +1239,10 @@ package body Inline is ...@@ -1239,11 +1239,10 @@ package body Inline is
and then Msg (Msg'First .. Msg'First + 12) = "cannot inline" and then Msg (Msg'First .. Msg'First + 12) = "cannot inline"
then then
declare declare
Len1 : constant Positive := 13; Len1 : constant Positive :=
-- Length of "cannot inline" String (String'("cannot inline"))'Length;
Len2 : constant Positive :=
Len2 : constant Positive := 31; String (String'("info: no contextual analysis of"))'Length;
-- Length of "info: no contextual analysis of"
New_Msg : String (1 .. Msg'Length + Len2 - Len1); New_Msg : String (1 .. Msg'Length + Len2 - Len1);
......
...@@ -153,13 +153,13 @@ package System.Tasking.Debug is ...@@ -153,13 +153,13 @@ package System.Tasking.Debug is
(Dependent : Task_Id; (Dependent : Task_Id;
Parent : Task_Id; Parent : Task_Id;
Master_Level : Integer); Master_Level : Integer);
-- Indicate to Valgrind/Helgrind that the master of Dependent -- Indicate to Valgrind/Helgrind that the master of Dependent is
-- is Parent + Master_Level. -- Parent + Master_Level.
procedure Master_Completed_Hook procedure Master_Completed_Hook
(Self_ID : Task_Id; (Self_ID : Task_Id;
Master_Level : Integer); Master_Level : Integer);
-- Indicate to Valgrind/Helgrind that Self_ID has completed -- Indicate to Valgrind/Helgrind that Self_ID has completed the master
-- the master Master_Level. -- Master_Level.
end System.Tasking.Debug; end System.Tasking.Debug;
...@@ -1674,10 +1674,9 @@ package body Sem_Ch12 is ...@@ -1674,10 +1674,9 @@ package body Sem_Ch12 is
Present Present
(Get_First_Parent_With_Ext_Axioms_For_Entity (Get_First_Parent_With_Ext_Axioms_For_Entity
(Defining_Entity (Analyzed_Formal))) (Defining_Entity (Analyzed_Formal)))
and then Ekind (Defining_Entity (Analyzed_Formal)) and then Ekind (Defining_Entity (Analyzed_Formal)) =
= E_Function E_Function
then then
-- If actual is an entity (function or operator), -- If actual is an entity (function or operator),
-- build wrapper for it. -- build wrapper for it.
...@@ -1700,8 +1699,8 @@ package body Sem_Ch12 is ...@@ -1700,8 +1699,8 @@ package body Sem_Ch12 is
-- Ditto if formal is an operator with a default. -- Ditto if formal is an operator with a default.
elsif Box_Present (Formal) elsif Box_Present (Formal)
and then Nkind (Defining_Entity (Analyzed_Formal)) and then Nkind (Defining_Entity (Analyzed_Formal)) =
= N_Defining_Operator_Symbol N_Defining_Operator_Symbol
then then
Append_To (Assoc, Append_To (Assoc,
Build_Wrapper Build_Wrapper
......
...@@ -9936,7 +9936,8 @@ package body Sem_Ch13 is ...@@ -9936,7 +9936,8 @@ package body Sem_Ch13 is
procedure Freeze_Entity_Checks (N : Node_Id) is procedure Freeze_Entity_Checks (N : Node_Id) is
procedure Hide_Non_Overridden_Subprograms (Typ : Entity_Id); procedure Hide_Non_Overridden_Subprograms (Typ : Entity_Id);
-- Inspect the primitive operations of type Typ and hide all pairs of -- Inspect the primitive operations of type Typ and hide all pairs of
-- implicitly declared non-overridden homographs (Ada RM 8.3 12.3/2). -- implicitly declared non-overridden non-fully conformant homographs
-- (Ada RM 8.3 12.3/2).
------------------------------------- -------------------------------------
-- Hide_Non_Overridden_Subprograms -- -- Hide_Non_Overridden_Subprograms --
...@@ -9947,9 +9948,9 @@ package body Sem_Ch13 is ...@@ -9947,9 +9948,9 @@ package body Sem_Ch13 is
(Subp_Id : Entity_Id; (Subp_Id : Entity_Id;
Start_Elmt : Elmt_Id); Start_Elmt : Elmt_Id);
-- Inspect a list of primitive operations starting with Start_Elmt -- Inspect a list of primitive operations starting with Start_Elmt
-- and find matching implicitly declared non-overridden homographs -- and find matching implicitly declared non-overridden non-fully
-- of Subp_Id. If found, all matches along with Subp_Id are hidden -- conformant homographs of Subp_Id. If found, all matches along
-- from all visibility. -- with Subp_Id are hidden from all visibility.
function Is_Non_Overridden_Or_Null_Procedure function Is_Non_Overridden_Or_Null_Procedure
(Subp_Id : Entity_Id) return Boolean; (Subp_Id : Entity_Id) return Boolean;
...@@ -9973,11 +9974,12 @@ package body Sem_Ch13 is ...@@ -9973,11 +9974,12 @@ package body Sem_Ch13 is
Prim := Node (Prim_Elmt); Prim := Node (Prim_Elmt);
-- The current primitive is implicitly declared non-overridden -- The current primitive is implicitly declared non-overridden
-- homograph of Subp_Id. Hide both subprograms from visibility. -- non-fully conformant homograph of Subp_Id. Both subprograms
-- must be hidden from visibility.
if Chars (Prim) = Chars (Subp_Id) if Chars (Prim) = Chars (Subp_Id)
and then Ekind (Prim) = Ekind (Subp_Id)
and then Is_Non_Overridden_Or_Null_Procedure (Prim) and then Is_Non_Overridden_Or_Null_Procedure (Prim)
and then not Fully_Conformant (Prim, Subp_Id)
then then
Set_Is_Hidden_Non_Overridden_Subprogram (Prim); Set_Is_Hidden_Non_Overridden_Subprogram (Prim);
Set_Is_Immediately_Visible (Prim, False); Set_Is_Immediately_Visible (Prim, False);
...@@ -10034,8 +10036,8 @@ package body Sem_Ch13 is ...@@ -10034,8 +10036,8 @@ package body Sem_Ch13 is
-- Start of processing for Hide_Non_Overridden_Subprograms -- Start of processing for Hide_Non_Overridden_Subprograms
begin begin
-- Inspect the list of primitives looking for a non-overriding -- Inspect the list of primitives looking for non-overridden
-- inherited null procedure. -- subprograms.
if Present (Prim_Ops) then if Present (Prim_Ops) then
Prim_Elmt := First_Elmt (Prim_Ops); Prim_Elmt := First_Elmt (Prim_Ops);
...@@ -10106,7 +10108,7 @@ package body Sem_Ch13 is ...@@ -10106,7 +10108,7 @@ package body Sem_Ch13 is
-- abstract subprograms, null procedures and subprograms that require -- abstract subprograms, null procedures and subprograms that require
-- overriding. If this set contains fully conformat homographs, then one -- overriding. If this set contains fully conformat homographs, then one
-- is chosen arbitrarily (already done during resolution), otherwise all -- is chosen arbitrarily (already done during resolution), otherwise all
-- remaining non-conformant homographs must be hidden from visibility -- remaining non-fully conformant homographs are hidden from visibility
-- (Ada RM 8.3 12.3/2). -- (Ada RM 8.3 12.3/2).
if Is_Tagged_Type (E) then if Is_Tagged_Type (E) then
......
...@@ -1986,9 +1986,7 @@ package body Sem_Ch7 is ...@@ -1986,9 +1986,7 @@ package body Sem_Ch7 is
-- a tagged type back into visibility if they have non-conformant -- a tagged type back into visibility if they have non-conformant
-- homographs (Ada RM 8.3 12.3/2). -- homographs (Ada RM 8.3 12.3/2).
elsif Ekind_In (Id, E_Function, E_Procedure) elsif Is_Hidden_Non_Overridden_Subprogram (Id) then
and then Is_Hidden_Non_Overridden_Subprogram (Id)
then
null; null;
else else
......
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