home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
gnat-2.06-src.tgz
/
tar.out
/
fsf
/
gnat
/
ada
/
exp_ch11.adb
< prev
next >
Wrap
Text File
|
1996-09-28
|
3KB
|
75 lines
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ C H 1 1 --
-- --
-- B o d y --
-- --
-- $Revision: 1.3 $ --
-- --
-- Copyright (c) 1992,1993, NYU, All Rights Reserved --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. GNAT is distributed in the hope that it will be useful, but --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANT- --
-- ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public --
-- License for more details. You should have received a copy of the GNU --
-- General Public License along with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Einfo; use Einfo;
with Exp_Ch7; use Exp_Ch7;
with Sinfo; use Sinfo;
with Sem; use Sem;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Tbuild; use Tbuild;
with Rtsfind; use Rtsfind;
package body Exp_Ch11 is
---------------------------------------------
-- Expand_N_Handled_Sequence_Of_Statements --
---------------------------------------------
procedure Expand_N_Handled_Sequence_Of_Statements (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Undefer : Node_Id;
Handler : Node_Id;
Handlers : constant List_Id := Exception_Handlers (N);
begin
-- Add a call to Abort_Undefer to the front of all exception handlers.
-- Abortion is deferred as part of raising an exception, to prevent
-- cleanup activities from being aborted.
if Present (Handlers) then
Handler := First (Handlers);
while Present (Handler) loop
Undefer :=
Make_Procedure_Call_Statement (Loc,
Name =>
New_Reference_To (RTE (RE_Abort_Undefer), Loc),
Parameter_Associations => Empty_List);
Prepend_To (Statements (Handler), Undefer);
Analyze (Undefer);
Handler := Next (Handler);
end loop;
end if;
if Nkind (Parent (N)) /= N_Package_Body
and then Nkind (Parent (N)) /= N_Accept_Statement
then
Expand_Cleanup_Actions (Parent (N));
end if;
end Expand_N_Handled_Sequence_Of_Statements;
end Exp_Ch11;