[multiple changes]
2015-05-12 Tristan Gingold <gingold@adacore.com> * i-cpoint.adb (Copy_Terminated_Array): Copy nothing if Length is 0. 2015-05-12 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Complete_Private_Subtype): Propagate Has_Delayed_Aspects flag from private to full view, to ensure that predicate functions are constructed. 2015-05-12 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Process_Formals): If a tagged formal is an incomplete class-wide type, the subprogram must have a delayed freeze even though the opertation is not a primitive of the type. THis ensures that the backend can recover the full view when elaborating the subprogram declaration. 2015-05-12 Ed Schonberg <schonberg@adacore.com> * exp_util.adb (Get_Current_Value_Condition): Nothing to be done if an elsif part has been rewritten so that it is not part of an enclosing if_statement. From-SVN: r223040
This commit is contained in:
parent
e23e04db7b
commit
a0a1085334
|
@ -1,3 +1,27 @@
|
||||||
|
2015-05-12 Tristan Gingold <gingold@adacore.com>
|
||||||
|
|
||||||
|
* i-cpoint.adb (Copy_Terminated_Array): Copy nothing if Length is 0.
|
||||||
|
|
||||||
|
2015-05-12 Ed Schonberg <schonberg@adacore.com>
|
||||||
|
|
||||||
|
* sem_ch3.adb (Complete_Private_Subtype): Propagate
|
||||||
|
Has_Delayed_Aspects flag from private to full view, to ensure
|
||||||
|
that predicate functions are constructed.
|
||||||
|
|
||||||
|
2015-05-12 Ed Schonberg <schonberg@adacore.com>
|
||||||
|
|
||||||
|
* sem_ch6.adb (Process_Formals): If a tagged formal is an
|
||||||
|
incomplete class-wide type, the subprogram must have a delayed
|
||||||
|
freeze even though the opertation is not a primitive of the
|
||||||
|
type. THis ensures that the backend can recover the full view
|
||||||
|
when elaborating the subprogram declaration.
|
||||||
|
|
||||||
|
2015-05-12 Ed Schonberg <schonberg@adacore.com>
|
||||||
|
|
||||||
|
* exp_util.adb (Get_Current_Value_Condition): Nothing to be
|
||||||
|
done if an elsif part has been rewritten so that it is not part
|
||||||
|
of an enclosing if_statement.
|
||||||
|
|
||||||
2015-05-12 Robert Dewar <dewar@adacore.com>
|
2015-05-12 Robert Dewar <dewar@adacore.com>
|
||||||
|
|
||||||
* sem_type.adb, sem_ch10.adb, freeze.adb, sem_ch6.adb, exp_disp.adb:
|
* sem_type.adb, sem_ch10.adb, freeze.adb, sem_ch6.adb, exp_disp.adb:
|
||||||
|
|
|
@ -3366,6 +3366,13 @@ package body Exp_Util is
|
||||||
|
|
||||||
Stm := Parent (CV);
|
Stm := Parent (CV);
|
||||||
|
|
||||||
|
-- If the tree has been otherwise rewritten there is nothing
|
||||||
|
-- else to be done either.
|
||||||
|
|
||||||
|
if Nkind (Stm) /= N_If_Statement then
|
||||||
|
return;
|
||||||
|
end if;
|
||||||
|
|
||||||
-- Before start of ELSIF part
|
-- Before start of ELSIF part
|
||||||
|
|
||||||
if Loc < Sloc (CV) then
|
if Loc < Sloc (CV) then
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
-- --
|
-- --
|
||||||
-- B o d y --
|
-- B o d y --
|
||||||
-- --
|
-- --
|
||||||
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
|
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
|
||||||
-- --
|
-- --
|
||||||
-- GNAT is free software; you can redistribute it and/or modify it under --
|
-- GNAT is free software; you can redistribute it and/or modify it under --
|
||||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||||
|
@ -151,11 +151,12 @@ package body Interfaces.C.Pointers is
|
||||||
raise Dereference_Error;
|
raise Dereference_Error;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- Compute array length (including the terminator)
|
-- Compute array limited length (including the terminator)
|
||||||
|
|
||||||
L := 1;
|
L := 0;
|
||||||
while S.all /= Terminator and then L < Limit loop
|
while L < Limit loop
|
||||||
L := L + 1;
|
L := L + 1;
|
||||||
|
exit when S.all = Terminator;
|
||||||
Increment (S);
|
Increment (S);
|
||||||
end loop;
|
end loop;
|
||||||
|
|
||||||
|
|
|
@ -11625,7 +11625,8 @@ package body Sem_Ch3 is
|
||||||
-- Freeze the private subtype entity if its parent is delayed, and not
|
-- Freeze the private subtype entity if its parent is delayed, and not
|
||||||
-- already frozen. We skip this processing if the type is an anonymous
|
-- already frozen. We skip this processing if the type is an anonymous
|
||||||
-- subtype of a record component, or is the corresponding record of a
|
-- subtype of a record component, or is the corresponding record of a
|
||||||
-- protected type, since ???
|
-- protected type, since these are processed when the enclosing type
|
||||||
|
-- is frozen.
|
||||||
|
|
||||||
if not Is_Type (Scope (Full)) then
|
if not Is_Type (Scope (Full)) then
|
||||||
Set_Has_Delayed_Freeze (Full,
|
Set_Has_Delayed_Freeze (Full,
|
||||||
|
@ -11804,11 +11805,19 @@ package body Sem_Ch3 is
|
||||||
|
|
||||||
-- Make sure Has_Predicates is set on full type if it is set on the
|
-- Make sure Has_Predicates is set on full type if it is set on the
|
||||||
-- private type. Note that it may already be set on the full type and
|
-- private type. Note that it may already be set on the full type and
|
||||||
-- if so, we don't want to unset it.
|
-- if so, we don't want to unset it. Similarly, propagate information
|
||||||
|
-- about delayed aspects, because the corresponding pragmas must be
|
||||||
|
-- analyzed when one of the views is frozen. This last step is needed
|
||||||
|
-- in particular when the full type is a scalar type for which an
|
||||||
|
-- anonymous base type is constructed.
|
||||||
|
|
||||||
if Has_Predicates (Priv) then
|
if Has_Predicates (Priv) then
|
||||||
Set_Has_Predicates (Full);
|
Set_Has_Predicates (Full);
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
|
if Has_Delayed_Aspects (Priv) then
|
||||||
|
Set_Has_Delayed_Aspects (Full);
|
||||||
|
end if;
|
||||||
end Complete_Private_Subtype;
|
end Complete_Private_Subtype;
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
|
@ -10206,7 +10206,9 @@ package body Sem_Ch6 is
|
||||||
-- it is still the case that untagged incomplete types cannot
|
-- it is still the case that untagged incomplete types cannot
|
||||||
-- be Taft-amendment types and must be completed in private
|
-- be Taft-amendment types and must be completed in private
|
||||||
-- part, so the subprogram must appear in the list of private
|
-- part, so the subprogram must appear in the list of private
|
||||||
-- dependents of the type.
|
-- dependents of the type. If the type is class-wide, it is
|
||||||
|
-- not a primitive, but the freezing of the subprogram must
|
||||||
|
-- also be delayed to force the creation of a freeze node.
|
||||||
|
|
||||||
if Is_Tagged_Type (Formal_Type)
|
if Is_Tagged_Type (Formal_Type)
|
||||||
or else (Ada_Version >= Ada_2012
|
or else (Ada_Version >= Ada_2012
|
||||||
|
@ -10215,15 +10217,15 @@ package body Sem_Ch6 is
|
||||||
then
|
then
|
||||||
if Ekind (Scope (Current_Scope)) = E_Package
|
if Ekind (Scope (Current_Scope)) = E_Package
|
||||||
and then not Is_Generic_Type (Formal_Type)
|
and then not Is_Generic_Type (Formal_Type)
|
||||||
and then not Is_Class_Wide_Type (Formal_Type)
|
|
||||||
then
|
then
|
||||||
if not Nkind_In
|
if not Nkind_In
|
||||||
(Parent (T), N_Access_Function_Definition,
|
(Parent (T), N_Access_Function_Definition,
|
||||||
N_Access_Procedure_Definition)
|
N_Access_Procedure_Definition)
|
||||||
then
|
then
|
||||||
Append_Elmt
|
if not Is_Class_Wide_Type (Formal_Type) then
|
||||||
(Current_Scope,
|
Append_Elmt (Current_Scope,
|
||||||
To => Private_Dependents (Base_Type (Formal_Type)));
|
Private_Dependents (Base_Type (Formal_Type)));
|
||||||
|
end if;
|
||||||
|
|
||||||
-- Freezing is delayed to ensure that Register_Prim
|
-- Freezing is delayed to ensure that Register_Prim
|
||||||
-- will get called for this operation, which is needed
|
-- will get called for this operation, which is needed
|
||||||
|
|
Loading…
Reference in New Issue