+2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_util.adb, sem_aux.adb, exp_attr.adb, sem_eval.adb: Minor
+ reformatting.
+ * sem_util.adb, sem_ch5.adb: Minor reformatting.
+
+2015-10-26 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_unst.adb (Unnest_Subprogram): Add guard to prevent compiler
+ abort when handling a reference to a formal in an aspect of a
+ nested subprogram declaration as an uplevel reference.
+
2015-10-26 Bob Duff <duff@adacore.com>
* snames.ads-tmpl, aspects.adb, aspects.ads: Add the aspect and
elsif Ekind (Entity (Pref)) = E_Constant
and then Present (Renamed_Object (Entity (Pref)))
- and then
- Ekind (Entity (Renamed_Object (Entity (Pref))))
- = E_Enumeration_Literal
+ and then Ekind (Entity (Renamed_Object (Entity (Pref)))) =
+ E_Enumeration_Literal
then
Rewrite (N,
Make_Integer_Literal (Loc,
-- both cases the type of the first formal of their expanded
-- subprogram is Address)
- if Etype (First_Entity (Protected_Body_Subprogram (Subprg)))
- = RTE (RE_Address)
+ if Etype (First_Entity (Protected_Body_Subprogram (Subprg))) =
+ RTE (RE_Address)
then
declare
New_Itype : Entity_Id;
-- We have a new uplevel referenced entity
-- All we do at this stage is to add the uplevel reference to
- -- the table. It's too earch to do anything else, since this
+ -- the table. It's too early to do anything else, since this
-- uplevel reference may come from an unreachable subprogram
-- in which case the entry will be deleted.
S := URJ.Caller;
loop
S := Enclosing_Subprogram (S);
+
+ -- if we are at the top level, as can happen with
+ -- references to formals in aspects of nested subprogram
+ -- declarations, there are no further subprograms to
+ -- mark as requiring activation records.
+
+ exit when No (S);
Subps.Table (Subp_Index (S)).Declares_AREC := True;
exit when S = URJ.Callee;
end loop;
Expr : Node_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (Expr);
- Nam : Name_Id;
Arg_List : List_Id;
+ Nam : Name_Id;
begin
- -- If predicate checks are suppressed, then return a null statement.
- -- For this call, we check only the scope setting. If the caller wants
- -- to check a specific entity's setting, they must do it manually.
+ -- If predicate checks are suppressed, then return a null statement. For
+ -- this call, we check only the scope setting. If the caller wants to
+ -- check a specific entity's setting, they must do it manually.
if Predicate_Checks_Suppressed (Empty) then
return Make_Null_Statement (Loc);
Append_To (Arg_List,
Make_Pragma_Argument_Association (Loc,
Expression =>
- New_Copy_Tree (Expression
- (Find_Aspect (Typ, Aspect_Predicate_Failure)))));
+ New_Copy_Tree
+ (Expression (Find_Aspect (Typ, Aspect_Predicate_Failure)))));
end if;
return
-- If there is an expression, return it
elsif Present (Expression (D)) then
- return (Expression (D));
+ return Expression (D);
-- For a constant, see if we have a full view
Get_First_Interp (Lhs, I, It);
while Present (It.Typ) loop
+
-- An indexed component with generalized indexing is always
- -- overloaded with the corresponding dereference. Discard
- -- the interpretation that yields a reference type, which
- -- is not assignable.
+ -- overloaded with the corresponding dereference. Discard the
+ -- interpretation that yields a reference type, which is not
+ -- assignable.
if Nkind (Lhs) = N_Indexed_Component
and then Present (Generalized_Indexing (Lhs))
Source_Type : constant Entity_Id := Etype (Operand);
Target_Type : constant Entity_Id := Etype (N);
- Stat : Boolean;
- Fold : Boolean;
-
function To_Be_Treated_As_Integer (T : Entity_Id) return Boolean;
-- Returns true if type T is an integer type, or if it is a fixed-point
-- type to be treated as an integer (i.e. the flag Conversion_OK is set
or else (Is_Fixed_Point_Type (T) and then not Conversion_OK (N));
end To_Be_Treated_As_Real;
+ -- Local variables
+
+ Fold : Boolean;
+ Stat : Boolean;
+
-- Start of processing for Eval_Type_Conversion
begin
-------------------------
function Denotes_Same_Prefix (A1, A2 : Node_Id) return Boolean is
-
begin
if Is_Entity_Name (A1) then
if Nkind_In (A2, N_Selected_Component, N_Indexed_Component)
return Defining_Entity (Unit);
end if;
end Get_Parent_Entity;
+
-------------------
-- Get_Pragma_Id --
-------------------
Comp : Entity_Id;
begin
- -- A scalar type is fully default initialized if it is subjec to aspect
+ -- A scalar type is fully default initialized if it is subject to aspect
-- Default_Value.
if Is_Scalar_Type (Typ) then