Commit b943a971 by Arnaud Charlet

[multiple changes]

2016-04-21  Gary Dismukes  <dismukes@adacore.com>

	* exp_attr.adb (Is_Inline_Floating_Point_Attribute): Suppress
	expansion of Attribute_Machine and Attribute_Model for AAMP.

2016-04-21  Ed Schonberg  <schonberg@adacore.com>

	* freeze.adb: Disable previous change for now.

2016-04-21  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb (Find_Selected_Component): If prefix has an
	access type and designated type is a limited view, introduce
	an explicit dereference before continuing the analysis, and
	set its type to the non-limited view of the designated type,
	if we are in context where it is available.

From-SVN: r235311
parent b1d8d229
2016-04-21 Gary Dismukes <dismukes@adacore.com>
* exp_attr.adb (Is_Inline_Floating_Point_Attribute): Suppress
expansion of Attribute_Machine and Attribute_Model for AAMP.
2016-04-21 Ed Schonberg <schonberg@adacore.com>
* freeze.adb: Disable previous change for now.
2016-04-21 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Find_Selected_Component): If prefix has an
access type and designated type is a limited view, introduce
an explicit dereference before continuing the analysis, and
set its type to the non-limited view of the designated type,
if we are in context where it is available.
2016-04-21 Ed Schonberg <schonberg@adacore.com> 2016-04-21 Ed Schonberg <schonberg@adacore.com>
* freeze.adb: Freeze profile in ASIS mode. * freeze.adb: Freeze profile in ASIS mode.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2016, 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- --
...@@ -7993,13 +7993,13 @@ package body Exp_Attr is ...@@ -7993,13 +7993,13 @@ package body Exp_Attr is
and then not Generate_C_Code; and then not Generate_C_Code;
end Is_GCC_Target; end Is_GCC_Target;
-- Start of processing for Exp_Attr -- Start of processing for Is_Inline_Floating_Point_Attribute
begin begin
-- Machine and Model can be expanded by the GCC backend only -- Machine and Model can be expanded by the GCC and AAMP back ends only
if Id = Attribute_Machine or else Id = Attribute_Model then if Id = Attribute_Machine or else Id = Attribute_Model then
return Is_GCC_Target; return Is_GCC_Target or else AAMP_On_Target;
-- Remaining cases handled by all back ends are Rounding and Truncation -- Remaining cases handled by all back ends are Rounding and Truncation
-- when appearing as the operand of a conversion to some integer type. -- when appearing as the operand of a conversion to some integer type.
......
...@@ -5008,11 +5008,13 @@ package body Freeze is ...@@ -5008,11 +5008,13 @@ package body Freeze is
-- Other constructs that should not freeze ??? -- Other constructs that should not freeze ???
-- This processing doesn't apply to internal entities (see below) -- This processing doesn't apply to internal entities (see below)
-- In ASIS mode the profile is frozen unconditionally, to prevent
-- backend anomalies. -- Disable this mechanism for now, to fix regressions in ASIS and
-- various ACATS tests. Implementation of AI05-019 remains
-- unsolved ???
if not Is_Internal (E) if not Is_Internal (E)
and then (Do_Freeze_Profile or ASIS_Mode) and then (Do_Freeze_Profile or else True)
then then
if not Freeze_Profile (E) then if not Freeze_Profile (E) then
Ghost_Mode := Save_Ghost_Mode; Ghost_Mode := Save_Ghost_Mode;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2016, 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- --
...@@ -6729,17 +6729,27 @@ package body Sem_Ch8 is ...@@ -6729,17 +6729,27 @@ package body Sem_Ch8 is
-- The designated type may be a limited view with no components. -- The designated type may be a limited view with no components.
-- Check whether the non-limited view is available, because in some -- Check whether the non-limited view is available, because in some
-- cases this will not be set when installing the context. -- cases this will not be set when installing the context. Rewrite
-- the node by introducing an explicit dereference at once, and
-- setting the type of the rewritten prefix to the non-limited view
-- of the original designated type.
if Is_Access_Type (P_Type) then if Is_Access_Type (P_Type) then
declare declare
D : constant Entity_Id := Directly_Designated_Type (P_Type); Desig_Typ : constant Entity_Id :=
Directly_Designated_Type (P_Type);
begin begin
if Is_Incomplete_Type (D) if Is_Incomplete_Type (Desig_Typ)
and then From_Limited_With (D) and then From_Limited_With (Desig_Typ)
and then Present (Non_Limited_View (D)) and then Present (Non_Limited_View (Desig_Typ))
then then
Set_Directly_Designated_Type (P_Type, Non_Limited_View (D)); Rewrite (P,
Make_Explicit_Dereference (Sloc (P),
Prefix => Relocate_Node (P)));
Set_Etype (P, Get_Full_View (Non_Limited_View (Desig_Typ)));
P_Type := Etype (P);
end if; end if;
end; end;
end if; end if;
...@@ -6930,6 +6940,16 @@ package body Sem_Ch8 is ...@@ -6930,6 +6940,16 @@ package body Sem_Ch8 is
else else
-- Format node as expanded name, to avoid cascaded errors -- Format node as expanded name, to avoid cascaded errors
-- If the limited_with transformation was applied earlier,
-- restore source for proper error reporting.
if not Comes_From_Source (P)
and then Nkind (P) = N_Explicit_Dereference
then
Rewrite (P, Prefix (P));
P_Type := Etype (P);
end if;
Change_Selected_Component_To_Expanded_Name (N); Change_Selected_Component_To_Expanded_Name (N);
Set_Entity (N, Any_Id); Set_Entity (N, Any_Id);
Set_Etype (N, Any_Type); Set_Etype (N, Any_Type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment