aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/freeze.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-09-08 11:19:34 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2017-09-08 11:19:34 +0200
commit780d73d73d39e83d6034d1d7b06c27091e9a9cdc (patch)
tree6cc2ed5afe27fb0e912331d77b4304f3168b6374 /gcc/ada/freeze.adb
parentb2c3160ca56fe11425e80fffff754f206faf9e19 (diff)
downloadgcc-780d73d73d39e83d6034d1d7b06c27091e9a9cdc.zip
gcc-780d73d73d39e83d6034d1d7b06c27091e9a9cdc.tar.gz
gcc-780d73d73d39e83d6034d1d7b06c27091e9a9cdc.tar.bz2
[multiple changes]
2017-09-08 Arnaud Charlet <charlet@adacore.com> * sem_util.ads, sem_util.adb (Is_CCT_Instance): moved from sem_prag.adb to make it available for GNATprove; for concurrent types replace custom scope climbing with Scope_Same_Or_Within; for single concurrent objects add scope climbing (with Scope_Within), which was not there (that's the primary semantic change of this commit); also, when comparing a single concurrent object with its corresponding concurrent type rely on equality of types, not of objects (because that's simpler to code). * sem_prag.adb (Is_CCT_Instance): lifted to sem_util.ads. (Analyze_Global_Item): adjust special-casing of references to the current instance of a concurrent unit in the Global contracts of task types and single tasks objects; similar for references in the protected operations and entries of protected types and single protected objects (in all these cases the current instance behaves as an implicit parameter and must not be mentioned in the Global contract). 2017-09-08 Arnaud Charlet <charlet@adacore.com> * exp_ch6.adb (Expand_Call_Helper): Introduce temporary for function calls returning a record within a subprogram call, for C generation. 2017-09-08 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Find_Expanded_Name): Handle properly an expanded name that designates the current instance of a child unit in its own body and appears as the prefix of a reference to an entity local to the child unit. * exp_ch6.adb, freeze.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb: Minor reformatting. 2017-09-08 Yannick Moy <moy@adacore.com> * sem_res.adb (Resolve_Equality_Op): Do not warn on comparisons that may be intentional. 2017-09-08 Tristan Gingold <gingold@adacore.com> * sem_warn.adb (Check_Unused_Withs): Remove test that disabled warnings on internal units in configurable run time mode. From-SVN: r251871
Diffstat (limited to 'gcc/ada/freeze.adb')
-rw-r--r--gcc/ada/freeze.adb34
1 files changed, 21 insertions, 13 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 8a3bf36..437951c 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -3423,16 +3423,12 @@ package body Freeze is
--------------------
function Freeze_Profile (E : Entity_Id) return Boolean is
- F_Type : Entity_Id;
- R_Type : Entity_Id;
- Warn_Node : Node_Id;
-
function Has_Incomplete_Component (T : Entity_Id) return Boolean;
- -- If a type includes a private component from an enclosing scope
- -- it cannot be frozen yet. This can happen in a package nested
- -- within another, when freezing an expression function whose
- -- profile depends on a type in some outer scope. Those types will
- -- be frozen at a later time in the enclosing unit.
+ -- If a type includes a private component from an enclosing scope it
+ -- cannot be frozen yet. This can happen in a package nested within
+ -- another, when freezing an expression function whose profile
+ -- depends on a type in some outer scope. Those types will be frozen
+ -- at a later time in the enclosing unit.
------------------------------
-- Has_Incomplete_Component --
@@ -3456,6 +3452,7 @@ package body Freeze is
while Present (Comp) loop
Comp_Typ := Etype (Comp);
+
if Ekind_In (Comp, E_Component, E_Discriminant)
and then Is_Private_Type (Comp_Typ)
and then No (Full_View (Comp_Typ))
@@ -3464,6 +3461,7 @@ package body Freeze is
then
return True;
end if;
+
Comp := Next_Entity (Comp);
end loop;
@@ -3471,16 +3469,26 @@ package body Freeze is
elsif Is_Array_Type (T) then
Comp_Typ := Component_Type (T);
- return Is_Private_Type (Comp_Typ)
- and then No (Full_View (Comp_Typ))
- and then In_Open_Scopes (Scope (Comp_Typ))
- and then Scope (Comp_Typ) /= Current_Scope;
+
+ return
+ Is_Private_Type (Comp_Typ)
+ and then No (Full_View (Comp_Typ))
+ and then In_Open_Scopes (Scope (Comp_Typ))
+ and then Scope (Comp_Typ) /= Current_Scope;
else
return False;
end if;
end Has_Incomplete_Component;
+ -- Local variables
+
+ F_Type : Entity_Id;
+ R_Type : Entity_Id;
+ Warn_Node : Node_Id;
+
+ -- Start of processing for Freeze_Profile
+
begin
-- Loop through formals