diff mbox

[Ada] Remove Complete_Single_Entry_Body

Message ID 20140129152520.GA29869@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Jan. 29, 2014, 3:25 p.m. UTC
This procedure was empty, so no need to insert a call to it.
No functional change.

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-01-29  Tristan Gingold  <gingold@adacore.com>

	* exp_ch9.adb (Build_Protected_Entry): Do not call
	Complete_Entry_Body anymore.
	* rtsfind.ads (RE_Complete_Single_Entry_Body): Remove.
	* s-tposen.ads, s-tposen.adb (Complete_Single_Entry_Body): Remove.
diff mbox

Patch

Index: exp_ch9.adb
===================================================================
--- exp_ch9.adb	(revision 207246)
+++ exp_ch9.adb	(working copy)
@@ -3847,9 +3847,10 @@ 
         Build_Protected_Entry_Specification (Loc, Edef, Empty);
 
       --  Add the following declarations:
+
       --    type poVP is access poV;
       --    _object : poVP := poVP (_O);
-      --
+
       --  where _O is the formal parameter associated with the concurrent
       --  object. These declarations are needed for Complete_Entry_Body.
 
@@ -3861,35 +3862,42 @@ 
       Add_Formal_Renamings (Espec, Op_Decls, Ent, Loc);
       Debug_Private_Data_Declarations (Decls);
 
+      --  Put the declarations and the statements from the entry
+
+      Op_Stats :=
+        New_List (
+          Make_Block_Statement (Loc,
+            Declarations => Decls,
+            Handled_Statement_Sequence =>
+              Handled_Statement_Sequence (N)));
+
       case Corresponding_Runtime_Package (Pid) is
          when System_Tasking_Protected_Objects_Entries =>
-            Complete :=
-              New_Reference_To (RTE (RE_Complete_Entry_Body), Loc);
+            Append_To (Op_Stats,
+              Make_Procedure_Call_Statement (End_Loc,
+                Name                   =>
+                  New_Reference_To (RTE (RE_Complete_Entry_Body), Loc),
+                Parameter_Associations => New_List (
+                  Make_Attribute_Reference (End_Loc,
+                    Prefix         =>
+                      Make_Selected_Component (End_Loc,
+                        Prefix        =>
+                          Make_Identifier (End_Loc, Name_uObject),
+                        Selector_Name =>
+                          Make_Identifier (End_Loc, Name_uObject)),
+                    Attribute_Name => Name_Unchecked_Access))));
 
          when System_Tasking_Protected_Objects_Single_Entry =>
-            Complete :=
-              New_Reference_To (RTE (RE_Complete_Single_Entry_Body), Loc);
 
+            --  Historically, a call to Complete_Single_Entry_Body was
+            --  inserted, but it was a null procedure.
+
+            null;
+
          when others =>
             raise Program_Error;
       end case;
 
-      Op_Stats := New_List (
-        Make_Block_Statement (Loc,
-          Declarations => Decls,
-          Handled_Statement_Sequence =>
-            Handled_Statement_Sequence (N)),
-
-        Make_Procedure_Call_Statement (End_Loc,
-          Name => Complete,
-          Parameter_Associations => New_List (
-            Make_Attribute_Reference (End_Loc,
-              Prefix =>
-                Make_Selected_Component (End_Loc,
-                  Prefix        => Make_Identifier (End_Loc, Name_uObject),
-                  Selector_Name => Make_Identifier (End_Loc, Name_uObject)),
-              Attribute_Name => Name_Unchecked_Access))));
-
       --  When exceptions can not be propagated, we never need to call
       --  Exception_Complete_Entry_Body
 
Index: rtsfind.ads
===================================================================
--- rtsfind.ads	(revision 207241)
+++ rtsfind.ads	(working copy)
@@ -1747,7 +1747,6 @@ 
      RE_Unlock_Entry,                    -- Protected_Objects.Single_Entry
      RE_Protected_Single_Entry_Call,     -- Protected_Objects.Single_Entry
      RE_Service_Entry,                   -- Protected_Objects.Single_Entry
-     RE_Complete_Single_Entry_Body,      -- Protected_Objects.Single_Entry
      RE_Exceptional_Complete_Single_Entry_Body,
      RE_Protected_Count_Entry,           -- Protected_Objects.Single_Entry
      RE_Protected_Single_Entry_Caller,   -- Protected_Objects.Single_Entry
@@ -3057,8 +3056,6 @@ 
        System_Tasking_Protected_Objects_Single_Entry,
      RE_Service_Entry                    =>
        System_Tasking_Protected_Objects_Single_Entry,
-     RE_Complete_Single_Entry_Body       =>
-       System_Tasking_Protected_Objects_Single_Entry,
      RE_Exceptional_Complete_Single_Entry_Body =>
        System_Tasking_Protected_Objects_Single_Entry,
      RE_Protected_Count_Entry            =>
Index: s-tposen.adb
===================================================================
--- s-tposen.adb	(revision 207241)
+++ s-tposen.adb	(working copy)
@@ -6,7 +6,7 @@ 
 --                                                                          --
 --                                B o d y                                   --
 --                                                                          --
---         Copyright (C) 1998-2009, Free Software Foundation, Inc.          --
+--         Copyright (C) 1998-2013, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNARL 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- --
@@ -278,20 +278,6 @@ 
    -- Restricted GNARLI --
    -----------------------
 
-   --------------------------------
-   -- Complete_Single_Entry_Body --
-   --------------------------------
-
-   procedure Complete_Single_Entry_Body (Object : Protection_Entry_Access) is
-      pragma Warnings (Off, Object);
-
-   begin
-      --  Nothing needs to do (Object.Call_In_Progress.Exception_To_Raise
-      --  has already been set to Null_Id).
-
-      null;
-   end Complete_Single_Entry_Body;
-
    --------------------------------------------
    -- Exceptional_Complete_Single_Entry_Body --
    --------------------------------------------
Index: s-tposen.ads
===================================================================
--- s-tposen.ads	(revision 207241)
+++ s-tposen.ads	(working copy)
@@ -250,12 +250,6 @@ 
    --  Same as the Protected_Entry_Call but with time-out specified.
    --  This routine is used to implement timed entry calls.
 
-   procedure Complete_Single_Entry_Body
-     (Object : Protection_Entry_Access);
-   pragma Inline (Complete_Single_Entry_Body);
-   --  Called from within an entry body procedure, indicates that the
-   --  corresponding entry call has been serviced.
-
    procedure Exceptional_Complete_Single_Entry_Body
      (Object : Protection_Entry_Access;
       Ex     : Ada.Exceptions.Exception_Id);