diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2015-02-20 09:45:50 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-02-20 10:45:50 +0100 |
commit | cf27c5a2bcf21d320a6d82de255f01e43a17a473 (patch) | |
tree | 43e8ac3d1e607e353a9b68c5520cfacd4776a6c2 /gcc/ada/inline.adb | |
parent | 2ac4a591c1673e190c131dbfd452bb1550cf9dbf (diff) | |
download | gcc-cf27c5a2bcf21d320a6d82de255f01e43a17a473.zip gcc-cf27c5a2bcf21d320a6d82de255f01e43a17a473.tar.gz gcc-cf27c5a2bcf21d320a6d82de255f01e43a17a473.tar.bz2 |
exp_ch3.adb (Default_Initialize_Object): Call Add_Inlined_Body on the Abort_Undefer_Direct function.
2015-02-20 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch3.adb (Default_Initialize_Object): Call Add_Inlined_Body on the
Abort_Undefer_Direct function.
* exp_ch5.adb (Expand_N_Assignment_Statement): Likewise.
* exp_intr.adb (Expand_Unc_Deallocation): Likewise.
* exp_prag.adb (Expand_Pragma_Abort_Defer): Likewise.
* exp_ch4.adb (Expand_N_Selected_Component): Adjust call to
Add_Inlined_Body.
* exp_ch6.adb (Expand_Call): Adjust calls to Add_Inlined_Body.
Remove call to Register_Backend_Call and move code resetting
Needs_Debug_Info on inlined subprograms to...
* inline.ads (Add_Inlined_Body): Add N parameter.
(Register_Backend_Call): Delete.
* inline.adb (Add_Inlined_Body): ...here and simplify.
Register the call with Backend_Calls directly.
(Register_Backend_Call): Delete.
* s-stalib.ads (Abort_Undefer_Direct): Restore pragma Inline.
From-SVN: r220841
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r-- | gcc/ada/inline.adb | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 896a5e4..74b3971 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -291,7 +291,7 @@ package body Inline is -- Add_Inlined_Body -- ---------------------- - procedure Add_Inlined_Body (E : Entity_Id) is + procedure Add_Inlined_Body (E : Entity_Id; N : Node_Id) is type Inline_Level_Type is (Dont_Inline, Inline_Call, Inline_Package); -- Level of inlining for the call: Dont_Inline means no inlining, @@ -376,6 +376,8 @@ package body Inline is -- Start of processing for Add_Inlined_Body begin + Append_New_Elmt (N, To => Backend_Calls); + -- Find unit containing E, and add to list of inlined bodies if needed. -- If the body is already present, no need to load any other unit. This -- is the case for an initialization procedure, which appears in the @@ -397,6 +399,7 @@ package body Inline is end if; Level := Must_Inline; + if Level /= Dont_Inline then declare Pack : constant Entity_Id := Get_Code_Unit_Entity (E); @@ -444,6 +447,21 @@ package body Inline is Inlined_Bodies.Table (Inlined_Bodies.Last) := Pack; end if; end if; + + -- If the call was generated by the compiler and is to a function + -- in a run-time unit, we need to suppress debugging information + -- for it, so that the code that is eventually inlined will not + -- affect debugging of the program. We do not do it if the call + -- comes from source because, even if the call is inlined, the + -- user may expect it to be present in the debugging information. + + if not Comes_From_Source (N) + and then In_Extended_Main_Source_Unit (N) + and then + Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (E))) + then + Set_Needs_Debug_Info (E, False); + end if; end; end if; end Add_Inlined_Body; @@ -3937,15 +3955,6 @@ package body Inline is Inlined.Release; end Lock; - --------------------------- - -- Register_Backend_Call -- - --------------------------- - - procedure Register_Backend_Call (N : Node_Id) is - begin - Append_New_Elmt (N, To => Backend_Calls); - end Register_Backend_Call; - -------------------------------- -- Remove_Aspects_And_Pragmas -- -------------------------------- |