(S : Entity_Id;
No_Interfaces : Boolean := False;
Interfaces_Only : Boolean := False;
+ Skip_Overridden : Boolean := False;
One_Only : Boolean := False) return Subprogram_List
is
Result : Subprogram_List (1 .. 6000);
end if;
end if;
+ -- Do not keep an overridden operation if its overridding operation
+ -- is in the results too, and it is not S. This can happen for
+ -- inheritance between interfaces.
+
+ if Skip_Overridden then
+ declare
+ Res : constant Subprogram_List (1 .. N) := Result (1 .. N);
+ M : Nat := 0;
+ begin
+ for J in 1 .. N loop
+ for K in 1 .. N loop
+ if Res (K) /= S
+ and then Res (J) = Overridden_Operation (Res (K))
+ then
+ goto Skip;
+ end if;
+ end loop;
+
+ M := M + 1;
+ Result (M) := Res (J);
+
+ <<Skip>>
+ end loop;
+
+ N := M;
+ end;
+ end if;
+
<<Done>>
return Result (1 .. N);
(S : Entity_Id;
No_Interfaces : Boolean := False;
Interfaces_Only : Boolean := False;
+ Skip_Overridden : Boolean := False;
One_Only : Boolean := False) return Subprogram_List renames
Inheritance_Utilities_Inst.Inherited_Subprograms;
(S : Entity_Id;
No_Interfaces : Boolean := False;
Interfaces_Only : Boolean := False;
+ Skip_Overridden : Boolean := False;
One_Only : Boolean := False) return Subprogram_List;
function Is_Overriding_Subprogram (E : Entity_Id) return Boolean;
(S : Entity_Id;
No_Interfaces : Boolean := False;
Interfaces_Only : Boolean := False;
+ Skip_Overridden : Boolean := False;
One_Only : Boolean := False) return Subprogram_List;
-- Given the spec of a subprogram, this function gathers any inherited
-- subprograms from direct inheritance or via interfaces. The result is an
-- subprograms inherited from interfaces. At most one of No_Interfaces
-- and Interfaces_Only should be True.
--
+ -- If Skip_Overridden is True, subprograms overridden by another subprogram
+ -- in the result list are skipped.
+ --
-- If One_Only is set, the search is discontinued as soon as one entry
-- is found. In this case the resulting array is either null or contains
-- exactly one element.