+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>
* switch-c.adb (Scan_Front_End_Switches): Do not fail when --RTS=
or else Nkind (Unit_Declaration_Node (Subp)) /=
N_Subprogram_Declaration
or else No (Body_To_Inline (Unit_Declaration_Node (Subp)))
+ or else Nkind (Body_To_Inline (Unit_Declaration_Node (Subp))) in
+ N_Entity
then
Add_Inlined_Body (Subp, Call_Node);
-- Front end expansion of simple functions returning unconstrained
- -- types (see Check_And_Split_Unconstrained_Function) and simple
- -- renamings inlined by the front end (see Build_Renamed_Body).
+ -- types (see Check_And_Split_Unconstrained_Function). Note that the
+ -- 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
Expand_Inlined_Call (Call_Node, Subp, Orig_Subp);
(Loc : Source_Ptr;
Id : Character;
Related_Nod : Node_Id := Empty) return Entity_Id;
- -- Create an external symbol of the form xxx_FIRST/_LAST if Related_Id
- -- is present, otherwise it generates an internal temporary.
+ -- Create an external symbol of the form xxx_FIRST/_LAST if Related_Nod
+ -- is present (xxx is taken from the Chars field of Related_Nod),
+ -- otherwise it generates an internal temporary.
---------------------
-- Build_Temporary --
return;
-- 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
- if not Has_Pragma_Inline (Subp) then
- return;
- end if;
+ return;
-- Skip inlining if the function returns an unconstrained type using
-- an extended return statement since this part of the new inlining