Commit 7813a510 by Robert Dewar Committed by Arnaud Charlet

exp_util.ads (Find_Prim_Op): Document that Program_Error is raised if no…

exp_util.ads (Find_Prim_Op): Document that Program_Error is raised if no primitive operation is found.

2008-07-30  Robert Dewar  <dewar@adacore.com>

	* exp_util.ads (Find_Prim_Op): Document that Program_Error is raised
	if no primitive operation is found.

	* exp_util.adb: (Find_Prim_Op): Add comments for previous change

From-SVN: r138329
parent 1adfc03b
...@@ -1582,6 +1582,8 @@ package body Exp_Util is ...@@ -1582,6 +1582,8 @@ package body Exp_Util is
Next_Elmt (Prim); Next_Elmt (Prim);
-- Raise Program_Error if no primitive found
if No (Prim) then if No (Prim) then
raise Program_Error; raise Program_Error;
end if; end if;
...@@ -1612,6 +1614,8 @@ package body Exp_Util is ...@@ -1612,6 +1614,8 @@ package body Exp_Util is
while not Is_TSS (Node (Prim), Name) loop while not Is_TSS (Node (Prim), Name) loop
Next_Elmt (Prim); Next_Elmt (Prim);
-- Raise program error if no primitive found
if No (Prim) then if No (Prim) then
raise Program_Error; raise Program_Error;
end if; end if;
......
...@@ -360,7 +360,10 @@ package Exp_Util is ...@@ -360,7 +360,10 @@ package Exp_Util is
-- Find the first primitive operation of type T whose name is 'Name'. -- Find the first primitive operation of type T whose name is 'Name'.
-- This function allows the use of a primitive operation which is not -- This function allows the use of a primitive operation which is not
-- directly visible. If T is a class wide type, then the reference is -- directly visible. If T is a class wide type, then the reference is
-- to an operation of the corresponding root type. -- to an operation of the corresponding root type. Raises Program_Error
-- exception if no primitive operation is found. This is normally an
-- internal error, but in some cases is an expected consequence of
-- illegalities elsewhere.
function Find_Prim_Op function Find_Prim_Op
(T : Entity_Id; (T : Entity_Id;
...@@ -370,6 +373,9 @@ package Exp_Util is ...@@ -370,6 +373,9 @@ package Exp_Util is
-- with the indicated suffix). This function allows use of a primitive -- with the indicated suffix). This function allows use of a primitive
-- operation which is not directly visible. If T is a class wide type, -- operation which is not directly visible. If T is a class wide type,
-- then the reference is to an operation of the corresponding root type. -- then the reference is to an operation of the corresponding root type.
-- Raises Program_Error exception if no primitive operation is found.
-- This is normally an internal error, but in some cases is an expected
-- consequence of illegalities elsewhere.
function Find_Protection_Object (Scop : Entity_Id) return Entity_Id; function Find_Protection_Object (Scop : Entity_Id) return Entity_Id;
-- Traverse the scope stack starting from Scop and look for an entry, -- Traverse the scope stack starting from Scop and look for an entry,
......
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