Commit 09edc2c2 by Arnaud Charlet

[multiple changes]

2015-02-20  Eric Botcazou  <ebotcazou@adacore.com>

	* inline.adb (Expand_Inlined_Call): Skip again calls to subprogram
	renamings.
	* exp_ch6.adb (Expand_Call): Use back-end inlining
	instead of expansion for simple subprogram renamings.

2015-02-20  Robert Dewar  <dewar@adacore.com>

	* exp_util.adb: Minor reformatting.

From-SVN: r220844
parent 22efcab7
2015-02-20 Eric Botcazou <ebotcazou@adacore.com>
* inline.adb (Expand_Inlined_Call): Skip again calls to subprogram
renamings.
* exp_ch6.adb (Expand_Call): Use back-end inlining
instead of expansion for simple subprogram renamings.
2015-02-20 Robert Dewar <dewar@adacore.com>
* exp_util.adb: Minor reformatting.
2015-02-20 Vincent Celier <celier@adacore.com> 2015-02-20 Vincent Celier <celier@adacore.com>
* switch-c.adb (Scan_Front_End_Switches): Do not fail when --RTS= * switch-c.adb (Scan_Front_End_Switches): Do not fail when --RTS=
......
...@@ -3778,12 +3778,17 @@ package body Exp_Ch6 is ...@@ -3778,12 +3778,17 @@ package body Exp_Ch6 is
or else Nkind (Unit_Declaration_Node (Subp)) /= or else Nkind (Unit_Declaration_Node (Subp)) /=
N_Subprogram_Declaration N_Subprogram_Declaration
or else No (Body_To_Inline (Unit_Declaration_Node (Subp))) or else No (Body_To_Inline (Unit_Declaration_Node (Subp)))
or else Nkind (Body_To_Inline (Unit_Declaration_Node (Subp))) in
N_Entity
then then
Add_Inlined_Body (Subp, Call_Node); Add_Inlined_Body (Subp, Call_Node);
-- Front end expansion of simple functions returning unconstrained -- Front end expansion of simple functions returning unconstrained
-- types (see Check_And_Split_Unconstrained_Function) and simple -- types (see Check_And_Split_Unconstrained_Function). Note that the
-- renamings inlined by the front end (see Build_Renamed_Body). -- case of a simple renaming (Body_To_Inline in N_Entity above, see
-- also Build_Renamed_Body) cannot be expanded here because this may
-- give rise to order-of-elaboration issues for the types of the
-- parameters of the subprogram, if any.
else else
Expand_Inlined_Call (Call_Node, Subp, Orig_Subp); Expand_Inlined_Call (Call_Node, Subp, Orig_Subp);
......
...@@ -7315,8 +7315,9 @@ package body Exp_Util is ...@@ -7315,8 +7315,9 @@ package body Exp_Util is
(Loc : Source_Ptr; (Loc : Source_Ptr;
Id : Character; Id : Character;
Related_Nod : Node_Id := Empty) return Entity_Id; Related_Nod : Node_Id := Empty) return Entity_Id;
-- Create an external symbol of the form xxx_FIRST/_LAST if Related_Id -- Create an external symbol of the form xxx_FIRST/_LAST if Related_Nod
-- is present, otherwise it generates an internal temporary. -- is present (xxx is taken from the Chars field of Related_Nod),
-- otherwise it generates an internal temporary.
--------------------- ---------------------
-- Build_Temporary -- -- Build_Temporary --
......
...@@ -2694,12 +2694,11 @@ package body Inline is ...@@ -2694,12 +2694,11 @@ package body Inline is
return; return;
-- Skip inlining if this is not a true inlining since the attribute -- Skip inlining if this is not a true inlining since the attribute
-- Body_To_Inline is also set for renamings (see sinfo.ads) -- Body_To_Inline is also set for renamings (see sinfo.ads). For a
-- true inlining, Orig_Bod has code rather than being an entity.
elsif Nkind (Orig_Bod) in N_Entity then elsif Nkind (Orig_Bod) in N_Entity then
if not Has_Pragma_Inline (Subp) then return;
return;
end if;
-- Skip inlining if the function returns an unconstrained type using -- Skip inlining if the function returns an unconstrained type using
-- an extended return statement since this part of the new inlining -- an extended return statement since this part of the new inlining
......
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