-- _clean; -- Added by Exp_Ch7.Expand_Cleanup_Actions
-- end;
-- exception
- -- when Abort_Signal => Abort_Undefer;
+ -- when Abort_Signal => null;
-- end;
-- parm := P.param;
-- _clean; -- Added by Exp_Ch7.Expand_Cleanup_Actions
-- end;
-- exception
- -- when Abort_Signal => Abort_Undefer;
+ -- when Abort_Signal => null;
-- end;
-- if not Cancelled (Bnn) then
-- _clean; -- Added by Exp_Ch7.Expand_Cleanup_Actions
-- end;
-- exception
- -- when Abort_Signal => Abort_Undefer;
+ -- when Abort_Signal => null;
-- end;
-- if not Cancelled (Bnn) then
-- _clean; -- Added by Exp_Ch7.Expand_Cleanup_Actions
-- end;
-- exception
- -- when Abort_Signal => Abort_Undefer;
+ -- when Abort_Signal => null;
-- end;
-- if not U then
Abrt : constant Node_Id := Abortable_Part (N);
Trig : constant Node_Id := Triggering_Alternative (N);
- Abort_Block_Ent : Entity_Id;
Abortable_Block : Node_Id;
Actuals : List_Id;
Astats : List_Id;
Ename : Node_Id;
Enqueue_Call : Node_Id;
Formals : List_Id;
- Hdle : List_Id;
Index : Node_Id;
Lim_Typ_Stmts : List_Id;
N_Orig : Node_Id;
-- begin
-- Cleanup_Block
-- exception
- -- when Abort_Signal => Abort_Undefer;
+ -- when Abort_Signal => null;
-- end;
- Abort_Block_Ent := Make_Temporary (Loc, 'A');
- ProtE_Stmts :=
- New_List (
- Make_Implicit_Label_Declaration (Loc,
- Defining_Identifier => Abort_Block_Ent),
-
- Build_Abort_Block
- (Loc, Abort_Block_Ent, Cleanup_Block_Ent, Cleanup_Block));
+ ProtE_Stmts := New_List (
+ Build_Abort_Block (Loc, Cleanup_Block_Ent, Cleanup_Block));
-- Generate:
-- if not Cancelled (Bnn) then
-- begin
-- Cleanup_Block
-- exception
- -- when Abort_Signal => Abort_Undefer;
+ -- when Abort_Signal => null;
-- end;
- Abort_Block_Ent := Make_Temporary (Loc, 'A');
-
- Append_To (TaskE_Stmts,
- Make_Implicit_Label_Declaration (Loc,
- Defining_Identifier => Abort_Block_Ent));
-
Append_To (TaskE_Stmts,
- Build_Abort_Block
- (Loc, Abort_Block_Ent, Cleanup_Block_Ent, Cleanup_Block));
+ Build_Abort_Block (Loc, Cleanup_Block_Ent, Cleanup_Block));
-- Generate:
-- if not T then
Prefix => New_Occurrence_Of (Dblock_Ent, Loc),
Attribute_Name => Name_Unchecked_Access));
- -- Create the inner block to protect the abortable part
-
- Hdle := New_List (Build_Abort_Block_Handler (Loc));
-
Prepend_To (Astats, Build_Runtime_Call (Loc, RE_Abort_Undefer));
Abortable_Block :=
Has_Created_Identifier => True,
Is_Asynchronous_Call_Block => True);
+ -- Wrap the abortable block in an exception handling block
+
+ -- Generate:
+ -- begin
+ -- Abortable_Block
+ -- exception
+ -- when Abort_Signal => null;
+ -- end;
+
+ Stmts := New_List (
+ Build_Abort_Block (Loc, Blk_Ent, Abortable_Block));
+
-- Append call to if Enqueue (When, DB'Unchecked_Access) then
Rewrite (Ecall,
Make_Function_Call (Loc,
Name => Enqueue_Call,
Parameter_Associations => Parameter_Associations (Ecall)),
- Then_Statements =>
- New_List (Make_Block_Statement (Loc,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements => New_List (
- Make_Implicit_Label_Declaration (Loc,
- Defining_Identifier => Blk_Ent,
- Label_Construct => Abortable_Block),
- Abortable_Block),
- Exception_Handlers => Hdle)))));
+ Then_Statements => Stmts));
Stmts := New_List (Ecall);
Has_Created_Identifier => True,
Is_Asynchronous_Call_Block => True);
- Stmts := New_List (
- Make_Block_Statement (Loc,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements => New_List (
- Make_Implicit_Label_Declaration (Loc,
- Defining_Identifier => Blk_Ent,
- Label_Construct => Abortable_Block),
- Abortable_Block),
-
- -- exception
+ -- Wrap the abortable block in an exception handling block
- Exception_Handlers => New_List (
- Make_Implicit_Exception_Handler (Loc,
-
- -- when Abort_Signal =>
- -- null;
+ -- Generate:
+ -- begin
+ -- Abortable_Block
+ -- exception
+ -- when Abort_Signal => null;
+ -- end;
- Exception_Choices =>
- New_List (New_Occurrence_Of (Stand.Abort_Signal, Loc)),
- Statements => New_List (Make_Null_Statement (Loc)))))),
+ Stmts := New_List (
+ Build_Abort_Block (Loc, Blk_Ent, Abortable_Block),
- -- if not Cancelled (Bnn) then
- -- triggered statements
- -- end if;
+ -- if not Cancelled (Bnn) then
+ -- triggered statements
+ -- end if;
Make_Implicit_If_Statement (N,
Condition => Make_Op_Not (Loc,
Call := Stmt;
- -- Create the inner block to protect the abortable part
-
- Hdle := New_List (Build_Abort_Block_Handler (Loc));
-
if Abort_Allowed then
Prepend_To (Astats, Build_Runtime_Call (Loc, RE_Abort_Undefer));
end if;
Has_Created_Identifier => True,
Is_Asynchronous_Call_Block => True);
+ -- Wrap the abortable block in an exception handling block
+
+ -- Generate:
+ -- begin
+ -- Abortable_Block
+ -- exception
+ -- when Abort_Signal => null;
+ -- end;
+
Insert_After (Call,
- Make_Block_Statement (Loc,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements => New_List (
- Make_Implicit_Label_Declaration (Loc,
- Defining_Identifier => Blk_Ent,
- Label_Construct => Abortable_Block),
- Abortable_Block),
- Exception_Handlers => Hdle)));
+ Build_Abort_Block (Loc, Blk_Ent, Abortable_Block));
-- Create new call statement