+2015-05-26 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch13.adb: sem_ch13.adb (Add_Predicates): Undo analysis
+ of original expression in ASIS mode: does not solve the ASIS
+ problem of a usable type information, and crashes the back-end
+ when performing type annotations.
+
+2015-05-26 Robert Dewar <dewar@adacore.com>
+
+ * sem_disp.adb (Inherited_Subprograms): Add One_Only parameter.
+ (Is_Overriding_Subprogram): Use One_Only_Parameter.
+ * sem_disp.ads (Inherited_Subprograms): Add One_Only parameter.
+
2015-05-26 Robert Dewar <dewar@adacore.com>
* exp_prag.adb, sem_ch3.adb, sem_ch5.adb, exp_ch11.adb, ghost.adb,
if Present (Asp) then
- -- For ASIS use, perform semantic analysis of the original
- -- predicate expression, which is otherwise not utilized.
-
- if ASIS_Mode then
- Preanalyze_And_Resolve (Expression (Asp));
- end if;
-
Set_Entity (Identifier (Asp), New_Copy_Tree (Arg2));
end if;
function Inherited_Subprograms
(S : Entity_Id;
No_Interfaces : Boolean := False;
- Interfaces_Only : Boolean := False) return Subprogram_List
+ Interfaces_Only : Boolean := False;
+ One_Only : Boolean := False) return Subprogram_List
is
Result : Subprogram_List (1 .. 6000);
-- 6000 here is intended to be infinity. We could use an expandable
if Is_Subprogram_Or_Generic_Subprogram (Parent_Op) then
Store_IS (Parent_Op);
+
+ if One_Only then
+ goto Done;
+ end if;
end if;
end loop;
end if;
-- We have found a primitive covered by S
Store_IS (Interface_Alias (Prim));
+
+ if One_Only then
+ goto Done;
+ end if;
end if;
Next_Elmt (Elmt);
end if;
end if;
+ <<Done>>
+
return Result (1 .. N);
end Inherited_Subprograms;
-- Is_Overriding_Subprogram --
------------------------------
- -- Seems inefficient, build a whole list of subprograms to see if it
- -- is non-empty???
-
function Is_Overriding_Subprogram (E : Entity_Id) return Boolean is
- Inherited : constant Subprogram_List := Inherited_Subprograms (E);
+ Inherited : constant Subprogram_List :=
+ Inherited_Subprograms (E, One_Only => True);
begin
return Inherited'Length > 0;
end Is_Overriding_Subprogram;
function Inherited_Subprograms
(S : Entity_Id;
No_Interfaces : Boolean := False;
- Interfaces_Only : Boolean := False) return Subprogram_List;
+ Interfaces_Only : 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 list is a
- -- list of entity id's of the specs of inherited subprograms. Returns a
+ -- subprograms from direct inheritance or via interfaces. The result is an
+ -- array of Entity_Ids of the specs of inherited subprograms. Returns a
-- null array if passed an Empty spec id. Note that the returned array
-- only includes subprograms and generic subprograms (and excludes any
-- other inherited entities, in particular enumeration literals). If
-- come first, starting with the closest ancestors, and are followed by
-- subprograms inherited from interfaces. At most one of No_Interfaces
-- and Interfaces_Only should be True.
+ --
+ -- 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.
function Is_Dynamically_Tagged (N : Node_Id) return Boolean;
-- Used to determine whether a call is dispatching, i.e. if it is