Commit d8d7e809 by Arnaud Charlet

[multiple changes]

2014-11-20  Bob Duff  <duff@adacore.com>

	* debug.adb: Minor comment fix.

2014-11-20  Arnaud Charlet  <charlet@adacore.com>

	* a-ciorma.adb: Minor update: move pragma Annotate up.
	* a-cfdlli.adb: Skip codepeer analysis on this body.

2014-11-20  Robert Dewar  <dewar@adacore.com>

	* sem_prag.adb (Analyze_Pragma, case No_Elaboration_Code_All):
	Allow use of this pragma with generic unit (package or subprogram).
	* gnat_rm.texi: Clarify that pragma No_Elaboration_Code_All can
	be applied to generics.

2014-11-20  Ed Schonberg  <schonberg@adacore.com>

	* sem_aggr.adb (Valid_Limited_Ancestor): Ancestor part of
	extension aggregate can itself be an extension aggregate, as
	well as a call that is rewritten as a reference.

2014-11-20  Eric Botcazou  <ebotcazou@adacore.com>

	* inline.adb (Add_Inlined_Subprogram): Insert all programs
	generated as a body or whose declaration was provided along with
	the body.

2014-11-20  Javier Miranda  <miranda@adacore.com>

	* sem.adb (Semantics): Disable expansion if we are compiling a
	separate unit under configurable runtime. By default separate
	units are compiled with expansion disabled but under configurable
	runtime we enable the expansion to get error messages about
	missing entities.

From-SVN: r217855
parent f2d9ae20
2014-11-20 Bob Duff <duff@adacore.com>
* debug.adb: Minor comment fix.
2014-11-20 Arnaud Charlet <charlet@adacore.com>
* a-ciorma.adb: Minor update: move pragma Annotate up.
* a-cfdlli.adb: Skip codepeer analysis on this body.
2014-11-20 Robert Dewar <dewar@adacore.com>
* sem_prag.adb (Analyze_Pragma, case No_Elaboration_Code_All):
Allow use of this pragma with generic unit (package or subprogram).
* gnat_rm.texi: Clarify that pragma No_Elaboration_Code_All can
be applied to generics.
2014-11-20 Ed Schonberg <schonberg@adacore.com>
* sem_aggr.adb (Valid_Limited_Ancestor): Ancestor part of
extension aggregate can itself be an extension aggregate, as
well as a call that is rewritten as a reference.
2014-11-20 Eric Botcazou <ebotcazou@adacore.com>
* inline.adb (Add_Inlined_Subprogram): Insert all programs
generated as a body or whose declaration was provided along with
the body.
2014-11-20 Javier Miranda <miranda@adacore.com>
* sem.adb (Semantics): Disable expansion if we are compiling a
separate unit under configurable runtime. By default separate
units are compiled with expansion disabled but under configurable
runtime we enable the expansion to get error messages about
missing entities.
2014-11-20 Robert Dewar <dewar@adacore.com> 2014-11-20 Robert Dewar <dewar@adacore.com>
* sem_ch13.adb: Minor reformatting. * sem_ch13.adb: Minor reformatting.
......
...@@ -30,6 +30,7 @@ with System; use type System.Address; ...@@ -30,6 +30,7 @@ with System; use type System.Address;
package body Ada.Containers.Formal_Doubly_Linked_Lists with package body Ada.Containers.Formal_Doubly_Linked_Lists with
SPARK_Mode => Off SPARK_Mode => Off
is is
pragma Annotate (CodePeer, Skip_Analysis);
----------------------- -----------------------
-- Local Subprograms -- -- Local Subprograms --
......
...@@ -38,9 +38,8 @@ pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys); ...@@ -38,9 +38,8 @@ pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys);
with System; use type System.Address; with System; use type System.Address;
package body Ada.Containers.Indefinite_Ordered_Maps is package body Ada.Containers.Indefinite_Ordered_Maps is
pragma Suppress (All_Checks);
pragma Annotate (CodePeer, Skip_Analysis); pragma Annotate (CodePeer, Skip_Analysis);
pragma Suppress (All_Checks);
----------------------------- -----------------------------
-- Node Access Subprograms -- -- Node Access Subprograms --
......
...@@ -249,7 +249,7 @@ package body Debug is ...@@ -249,7 +249,7 @@ package body Debug is
-- output (dt) or recreated source output (dg,do,ds) includes only -- output (dt) or recreated source output (dg,do,ds) includes only
-- the main unit. If df is set, then the output in either case -- the main unit. If df is set, then the output in either case
-- includes all compiled units (see also dg,do,ds,dt). Note that to -- includes all compiled units (see also dg,do,ds,dt). Note that to
-- be effective, this swich must be used in combination with one or -- be effective, this switch must be used in combination with one or
-- more of dt, dg, do or ds. -- more of dt, dg, do or ds.
-- dg Print the source recreated from the generated tree. In the case -- dg Print the source recreated from the generated tree. In the case
......
...@@ -4701,6 +4701,7 @@ the current unit and any extended main source units (body and subunits. ...@@ -4701,6 +4701,7 @@ the current unit and any extended main source units (body and subunits.
It also has has the effect of enforcing a transitive application of this It also has has the effect of enforcing a transitive application of this
aspect, so that if any unit is implicitly or explicitly WITH'ed by the aspect, so that if any unit is implicitly or explicitly WITH'ed by the
current unit, it must also have the No_Elaboration_Code_All aspect set. current unit, it must also have the No_Elaboration_Code_All aspect set.
It may be applied to package or subprogram specs or their generic versions.
@node Pragma No_Inline @node Pragma No_Inline
@unnumberedsec Pragma No_Inline @unnumberedsec Pragma No_Inline
......
...@@ -454,6 +454,7 @@ package body Inline is ...@@ -454,6 +454,7 @@ package body Inline is
procedure Add_Inlined_Subprogram (Index : Subp_Index) is procedure Add_Inlined_Subprogram (Index : Subp_Index) is
E : constant Entity_Id := Inlined.Table (Index).Name; E : constant Entity_Id := Inlined.Table (Index).Name;
Decl : constant Node_Id := Parent (Declaration_Node (E));
Pack : constant Entity_Id := Get_Code_Unit_Entity (E); Pack : constant Entity_Id := Get_Code_Unit_Entity (E);
procedure Register_Backend_Inlined_Subprogram (Subp : Entity_Id); procedure Register_Backend_Inlined_Subprogram (Subp : Entity_Id);
...@@ -486,14 +487,17 @@ package body Inline is ...@@ -486,14 +487,17 @@ package body Inline is
begin begin
-- If the subprogram is to be inlined, and if its unit is known to be -- If the subprogram is to be inlined, and if its unit is known to be
-- inlined or is an instance whose body will be analyzed anyway or the -- inlined or is an instance whose body will be analyzed anyway or the
-- subprogram has been generated by the compiler, and if it is declared -- subprogram was generated as a body by the compiler (for example an
-- initialization procedure) or its declaration was provided along with
-- the body (for example an expression function), and if it is declared
-- at the library level not in the main unit, and if it can be inlined -- at the library level not in the main unit, and if it can be inlined
-- by the back-end, then insert it in the list of inlined subprograms. -- by the back-end, then insert it in the list of inlined subprograms.
if Is_Inlined (E) if Is_Inlined (E)
and then (Is_Inlined (Pack) and then (Is_Inlined (Pack)
or else Is_Generic_Instance (Pack) or else Is_Generic_Instance (Pack)
or else Is_Internal (E)) or else Nkind (Decl) = N_Subprogram_Body
or else Present (Corresponding_Body (Decl)))
and then not In_Main_Unit_Or_Subunit (E) and then not In_Main_Unit_Or_Subunit (E)
and then not Is_Nested (E) and then not Is_Nested (E)
and then not Has_Initialized_Type (E) and then not Has_Initialized_Type (E)
......
...@@ -1433,11 +1433,13 @@ package body Sem is ...@@ -1433,11 +1433,13 @@ package body Sem is
-- error messages about missing entities in the run-time even -- error messages about missing entities in the run-time even
-- if we are compiling in -gnatc (no code generation) mode. -- if we are compiling in -gnatc (no code generation) mode.
-- Similar processing applies to No_Run_Time_Mode. However, -- Similar processing applies to No_Run_Time_Mode. However,
-- don't do this if debug flag -gnatd.Z is set (this is to handle -- don't do this if debug flag -gnatd.Z is set or when we are
-- a situation where this new processing causes trouble). -- compiling a separate unit (this is to handle a situation
-- where this new processing causes trouble).
or else ((Configurable_Run_Time_Mode or No_Run_Time_Mode) or else ((Configurable_Run_Time_Mode or No_Run_Time_Mode)
and not Debug_Flag_Dot_ZZ)); and not Debug_Flag_Dot_ZZ
and Nkind (Unit (Cunit (Main_Unit))) /= N_Subunit));
end if; end if;
Full_Analysis := True; Full_Analysis := True;
......
...@@ -2663,12 +2663,19 @@ package body Sem_Aggr is ...@@ -2663,12 +2663,19 @@ package body Sem_Aggr is
function Valid_Limited_Ancestor (Anc : Node_Id) return Boolean is function Valid_Limited_Ancestor (Anc : Node_Id) return Boolean is
begin begin
if Is_Entity_Name (Anc) if Is_Entity_Name (Anc) and then Is_Type (Entity (Anc)) then
and then Is_Type (Entity (Anc)) return True;
-- The ancestor must be a call or an aggregate, but a call may
-- have been expanded into a temporary, so check original node.
elsif Nkind_In (Anc, N_Aggregate,
N_Extension_Aggregate,
N_Function_Call)
then then
return True; return True;
elsif Nkind_In (Anc, N_Aggregate, N_Function_Call) then elsif Nkind (Original_Node (Anc)) = N_Function_Call then
return True; return True;
elsif Nkind (Anc) = N_Attribute_Reference elsif Nkind (Anc) = N_Attribute_Reference
......
...@@ -16729,9 +16729,11 @@ package body Sem_Prag is ...@@ -16729,9 +16729,11 @@ package body Sem_Prag is
return; return;
end if; end if;
-- Must appear for a spec -- Must appear for a spec or generic spec
if not Nkind_In (Unit (Cunit (Current_Sem_Unit)), if not Nkind_In (Unit (Cunit (Current_Sem_Unit)),
N_Generic_Package_Declaration,
N_Generic_Subprogram_Declaration,
N_Package_Declaration, N_Package_Declaration,
N_Subprogram_Declaration) N_Subprogram_Declaration)
then then
......
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