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> 2010-10-11 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve_Entry_Call): Generate 's' reference for entry * sem_res.adb (Resolve_Entry_Call): Generate 's' reference for entry
......
...@@ -5011,10 +5011,14 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5011,10 +5011,14 @@ gnat_to_gnu (Node_Id gnat_node)
case N_Abstract_Subprogram_Declaration: case N_Abstract_Subprogram_Declaration:
/* This subprogram doesn't exist for code generation purposes, but we /* This subprogram doesn't exist for code generation purposes, but we
have to elaborate the types of any parameters and result, unless 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 for (gnat_temp
= First_Formal_With_Extras = First_Formal_With_Extras
(Defining_Entity (Specification (gnat_node))); (Defining_Entity (Specification (gnat_node)));
...@@ -5024,9 +5028,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5024,9 +5028,7 @@ gnat_to_gnu (Node_Id gnat_node)
&& !From_With_Type (Etype (gnat_temp))) && !From_With_Type (Etype (gnat_temp)))
gnat_to_gnu_entity (Etype (gnat_temp), NULL_TREE, 0); gnat_to_gnu_entity (Etype (gnat_temp), NULL_TREE, 0);
/* Then the result type, set to Standard_Void_Type for procedures. */ /* Then the result type, set to Standard_Void_Type for procedures. */
{ {
Entity_Id gnat_temp_type Entity_Id gnat_temp_type
= Etype (Defining_Entity (Specification (gnat_node))); = Etype (Defining_Entity (Specification (gnat_node)));
......
...@@ -123,6 +123,13 @@ procedure Gnat1drv is ...@@ -123,6 +123,13 @@ procedure Gnat1drv is
Generate_SCIL := True; Generate_SCIL := True;
end if; 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 -- Set ASIS mode if -gnatt and -gnatc are set
if Operating_Mode = Check_Semantics and then Tree_Output then if Operating_Mode = Check_Semantics and then Tree_Output then
...@@ -136,10 +143,11 @@ procedure Gnat1drv is ...@@ -136,10 +143,11 @@ procedure Gnat1drv is
Inline_Active := False; Inline_Active := False;
-- Turn off SCIL generation in ASIS mode, since SCIL requires front- -- Turn off SCIL generation and CodePeer mode in semantics mode,
-- end expansion. -- since SCIL requires front-end expansion.
Generate_SCIL := False; Generate_SCIL := False;
CodePeer_Mode := False;
end if; end if;
-- SCIL mode needs to disable front-end inlining since the generated -- SCIL mode needs to disable front-end inlining since the generated
...@@ -160,10 +168,6 @@ procedure Gnat1drv is ...@@ -160,10 +168,6 @@ procedure Gnat1drv is
Front_End_Inlining := False; Front_End_Inlining := False;
Inline_Active := 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 -- Disable front-end optimizations, to keep the tree as close to the
-- source code as possible, and also to avoid inconsistencies between -- source code as possible, and also to avoid inconsistencies between
-- trees when using different optimization switches. -- trees when using different optimization switches.
......
...@@ -2490,6 +2490,7 @@ package body Sem_Ch10 is ...@@ -2490,6 +2490,7 @@ package body Sem_Ch10 is
elsif Unit_Kind = N_Package_Instantiation elsif Unit_Kind = N_Package_Instantiation
and then Nkind (U) = N_Package_Instantiation and then Nkind (U) = N_Package_Instantiation
and then Present (Instance_Spec (U))
then then
-- If the instance has not been rewritten as a package declaration, -- If the instance has not been rewritten as a package declaration,
-- then it appeared already in a previous with clause. Retrieve -- then it appeared already in a previous with clause. Retrieve
......
...@@ -4240,29 +4240,21 @@ package body Sem_Ch6 is ...@@ -4240,29 +4240,21 @@ package body Sem_Ch6 is
-- Start of processing for Check_Delayed_Subprogram -- Start of processing for Check_Delayed_Subprogram
begin 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 Possible_Freeze (Etype (Designator));
and then Is_Abstract_Subprogram (Designator) Possible_Freeze (Base_Type (Etype (Designator))); -- needed ???
then
null;
else
-- Need delayed freeze if return type itself needs a delayed
-- freeze and is not yet frozen.
Possible_Freeze (Etype (Designator)); -- Need delayed freeze if any of the formal types themselves need
Possible_Freeze (Base_Type (Etype (Designator))); -- needed ??? -- a delayed freeze and are not yet frozen.
-- Need delayed freeze if any of the formal types themselves need F := First_Formal (Designator);
-- a delayed freeze and are not yet frozen. while Present (F) loop
Possible_Freeze (Etype (F));
F := First_Formal (Designator); Possible_Freeze (Base_Type (Etype (F))); -- needed ???
while Present (F) loop Next_Formal (F);
Possible_Freeze (Etype (F)); end loop;
Possible_Freeze (Base_Type (Etype (F))); -- needed ???
Next_Formal (F);
end loop;
end if;
-- Mark functions that return by reference. Note that it cannot be -- Mark functions that return by reference. Note that it cannot be
-- done for delayed_freeze subprograms because the underlying -- 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