Commit 76e3504f by Arnaud Charlet

[multiple changes]

2010-10-11  Javier Miranda  <miranda@adacore.com>

	* sem_ch10.adb (Analyze_With_Clause): Add missing test to ensure
	availability of attribute Instance_Spec.

2010-10-11  Arnaud Charlet  <charlet@adacore.com>

	* gnat1drv.adb (Adjust_Global_Switches): Disable codepeer mode if
	checking syntax only or in ASIS mode.

2010-10-11  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch6.adb (Check_Delayed_Subprogram): Abstract subprograms may also
	need a freeze node if some type in the profile has one.
	* gcc-interface/trans.c (case N_Abstract_Subprogram_Declaration): If
	entity has a freeze node, defer elaboration.

2010-10-11  Emmanuel Briot  <briot@adacore.com>

	* prj-nmsc.adb (Check_Aggregate_Project): Add support for finding all
	aggregated projects.

From-SVN: r165287
parent ae6ede77
2010-10-11 Javier Miranda <miranda@adacore.com>
* sem_ch10.adb (Analyze_With_Clause): Add missing test to ensure
availability of attribute Instance_Spec.
2010-10-11 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable codepeer mode if
checking syntax only or in ASIS mode.
2010-10-11 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Check_Delayed_Subprogram): Abstract subprograms may also
need a freeze node if some type in the profile has one.
* gcc-interface/trans.c (case N_Abstract_Subprogram_Declaration): If
entity has a freeze node, defer elaboration.
2010-10-11 Emmanuel Briot <briot@adacore.com>
* prj-nmsc.adb (Check_Aggregate_Project): Add support for finding all
aggregated projects.
2010-10-11 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve_Entry_Call): Generate 's' reference for entry
......
......@@ -5011,10 +5011,14 @@ gnat_to_gnu (Node_Id gnat_node)
case N_Abstract_Subprogram_Declaration:
/* This subprogram doesn't exist for code generation purposes, but we
have to elaborate the types of any parameters and result, unless
they are imported types (nothing to generate in this case). */
they are imported types (nothing to generate in this case).
/* Process the parameter types first. */
The parameter list may contain types with freeze nodes, e.g. not null
subtypes, so the subprogram itself may carry a freeze node, in which
case its elaboration must be deferred. */
/* Process the parameter types first. */
if (No (Freeze_Node (Defining_Entity (Specification (gnat_node)))))
for (gnat_temp
= First_Formal_With_Extras
(Defining_Entity (Specification (gnat_node)));
......@@ -5024,9 +5028,7 @@ gnat_to_gnu (Node_Id gnat_node)
&& !From_With_Type (Etype (gnat_temp)))
gnat_to_gnu_entity (Etype (gnat_temp), NULL_TREE, 0);
/* Then the result type, set to Standard_Void_Type for procedures. */
{
Entity_Id gnat_temp_type
= Etype (Defining_Entity (Specification (gnat_node)));
......
......@@ -123,6 +123,13 @@ procedure Gnat1drv is
Generate_SCIL := True;
end if;
-- Disable CodePeer_Mode in Check_Syntax, since we need front-end
-- expansion.
if Operating_Mode = Check_Syntax then
CodePeer_Mode := False;
end if;
-- Set ASIS mode if -gnatt and -gnatc are set
if Operating_Mode = Check_Semantics and then Tree_Output then
......@@ -136,10 +143,11 @@ procedure Gnat1drv is
Inline_Active := False;
-- Turn off SCIL generation in ASIS mode, since SCIL requires front-
-- end expansion.
-- Turn off SCIL generation and CodePeer mode in semantics mode,
-- since SCIL requires front-end expansion.
Generate_SCIL := False;
CodePeer_Mode := False;
end if;
-- SCIL mode needs to disable front-end inlining since the generated
......@@ -160,10 +168,6 @@ procedure Gnat1drv is
Front_End_Inlining := False;
Inline_Active := False;
-- Turn off ASIS mode: incompatible with front-end expansion
ASIS_Mode := False;
-- Disable front-end optimizations, to keep the tree as close to the
-- source code as possible, and also to avoid inconsistencies between
-- trees when using different optimization switches.
......
......@@ -2490,6 +2490,7 @@ package body Sem_Ch10 is
elsif Unit_Kind = N_Package_Instantiation
and then Nkind (U) = N_Package_Instantiation
and then Present (Instance_Spec (U))
then
-- If the instance has not been rewritten as a package declaration,
-- then it appeared already in a previous with clause. Retrieve
......
......@@ -4240,29 +4240,21 @@ package body Sem_Ch6 is
-- Start of processing for Check_Delayed_Subprogram
begin
-- Never need to freeze abstract subprogram
-- All subprograms, including abstract subprograms, may need a freeze
-- node if some formal type or the return type needs one.
if Ekind (Designator) /= E_Subprogram_Type
and then Is_Abstract_Subprogram (Designator)
then
null;
else
-- Need delayed freeze if return type itself needs a delayed
-- freeze and is not yet frozen.
Possible_Freeze (Etype (Designator));
Possible_Freeze (Base_Type (Etype (Designator))); -- needed ???
Possible_Freeze (Etype (Designator));
Possible_Freeze (Base_Type (Etype (Designator))); -- needed ???
-- Need delayed freeze if any of the formal types themselves need
-- a delayed freeze and are not yet frozen.
-- Need delayed freeze if any of the formal types themselves need
-- a delayed freeze and are not yet frozen.
F := First_Formal (Designator);
while Present (F) loop
Possible_Freeze (Etype (F));
Possible_Freeze (Base_Type (Etype (F))); -- needed ???
Next_Formal (F);
end loop;
end if;
F := First_Formal (Designator);
while Present (F) loop
Possible_Freeze (Etype (F));
Possible_Freeze (Base_Type (Etype (F))); -- needed ???
Next_Formal (F);
end loop;
-- Mark functions that return by reference. Note that it cannot be
-- done for delayed_freeze subprograms because the underlying
......
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