+2013-02-06 Robert Dewar <dewar@adacore.com>
+
+ * s-dim.ads, clean.adb: Minor reformatting.
+
+2013-02-06 Javier Miranda <miranda@adacore.com>
+
+ * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Undo previous patch.
+ (Can_Split_Unconstrained_Function): Only split the inlined function if
+ the compiler generates the code of its body.
+
2013-02-06 Robert Dewar <dewar@adacore.com>
* exp_prag.adb, sem_ch3.adb, exp_attr.adb, sem_prag.adb, sem_ch6.adb,
-- --
-- S p e c --
-- --
--- Copyright (C) 2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2012-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
and then Serious_Errors_Detected = 0
and then Present (Spec_Id)
and then Has_Pragma_Inline (Spec_Id)
-
- -- This test needs commenting ???
-
- and then In_Extended_Main_Code_Unit (N)
then
Check_And_Build_Body_To_Inline (N, Spec_Id, Body_Id);
end if;
-- This body is subsequently used for inline expansions at call sites.
function Can_Split_Unconstrained_Function (N : Node_Id) return Boolean;
- -- Return true if the function body N has no local declarations and its
- -- unique statement is a single extended return statement with a handled
- -- statements sequence.
+ -- Return true if we generate code for the function body N, the function
+ -- body N has no local declarations and its unique statement is a single
+ -- extended return statement with a handled statements sequence.
function Check_Body_To_Inline
(N : Node_Id;
end loop;
end if;
- return Present (Ret_Node)
+ -- We only split the inlined function when we are generating the code
+ -- of its body; otherwise we leave duplicated split subprograms in
+ -- the tree which (if referenced) generate wrong references at link
+ -- time.
+
+ return In_Extended_Main_Code_Unit (N)
+ and then Present (Ret_Node)
and then Nkind (Ret_Node) = N_Extended_Return_Statement
and then No (Next (Ret_Node))
and then Present (Handled_Statement_Sequence (Ret_Node));