From f17f3601670ddeff49783fb6d10e41a555695b37 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Thu, 16 Apr 2009 09:35:38 +0000 Subject: [PATCH] exp_ch9.adb (Expand_N_Protected_Type_Declaration): If a protected operation has an inline pragma... 2009-04-16 Ed Schonberg * exp_ch9.adb (Expand_N_Protected_Type_Declaration): If a protected operation has an inline pragma, propagate the flag to the internal unprotected subprogram. From-SVN: r146156 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/exp_ch9.adb | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7c10005..6b706bd 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2009-04-16 Ed Schonberg + + * exp_ch9.adb (Expand_N_Protected_Type_Declaration): If a protected + operation has an inline pragma, propagate the flag to the internal + unprotected subprogram. + 2009-04-16 Doug Rupp * s-taprop-vxworks.adb, s-taprop-tru64.adb, s-taprop-mingw.adb, diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index e4afe67..0284943 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -7470,10 +7470,27 @@ package body Exp_Ch9 is E_Count : Int; Object_Comp : Node_Id; + procedure Check_Inlining (Subp : Entity_Id); + -- If the original operation has a pragma Inline, propagate the flag + -- to the internal body, for possible inlining later on. The source + -- operation is invisible to the back-end and is never actually called. + procedure Register_Handler; -- For a protected operation that is an interrupt handler, add the -- freeze action that will register it as such. + -------------------- + -- Check_Inlining -- + -------------------- + + procedure Check_Inlining (Subp : Entity_Id) is + begin + if Is_Inlined (Subp) then + Set_Is_Inlined (Protected_Body_Subprogram (Subp)); + Set_Is_Inlined (Subp, False); + end if; + end Check_Inlining; + ---------------------- -- Register_Handler -- ---------------------- @@ -7722,7 +7739,7 @@ package body Exp_Ch9 is Set_Protected_Body_Subprogram (Defining_Unit_Name (Specification (Priv)), Defining_Unit_Name (Specification (Sub))); - + Check_Inlining (Defining_Unit_Name (Specification (Priv))); Current_Node := Sub; Sub := @@ -7809,6 +7826,7 @@ package body Exp_Ch9 is Set_Protected_Body_Subprogram (Defining_Unit_Name (Specification (Comp)), Defining_Unit_Name (Specification (Sub))); + Check_Inlining (Defining_Unit_Name (Specification (Comp))); -- Make the protected version of the subprogram available for -- expansion of external calls. -- 2.7.4