aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2009-04-16 09:35:38 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-16 11:35:38 +0200
commitf17f3601670ddeff49783fb6d10e41a555695b37 (patch)
tree371893f5c05ecdcafc9b21849fc3cababeb2770a
parent5e44c5eab4a57d237cc1078bc0b57018b4915b51 (diff)
downloadgcc-f17f3601670ddeff49783fb6d10e41a555695b37.zip
gcc-f17f3601670ddeff49783fb6d10e41a555695b37.tar.gz
gcc-f17f3601670ddeff49783fb6d10e41a555695b37.tar.bz2
exp_ch9.adb (Expand_N_Protected_Type_Declaration): If a protected operation has an inline pragma...
2009-04-16 Ed Schonberg <schonberg@adacore.com> * 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
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/exp_ch9.adb20
2 files changed, 25 insertions, 1 deletions
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 <schonberg@adacore.com>
+
+ * 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 <rupp@adacore.com>
* 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.