1 |
281 |
jeremybenn |
------------------------------------------------------------------------------
|
2 |
|
|
-- --
|
3 |
|
|
-- GNAT COMPILER COMPONENTS --
|
4 |
|
|
-- --
|
5 |
|
|
-- E X P _ C H 1 1 --
|
6 |
|
|
-- --
|
7 |
|
|
-- S p e c --
|
8 |
|
|
-- --
|
9 |
|
|
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
|
10 |
|
|
-- --
|
11 |
|
|
-- GNAT is free software; you can redistribute it and/or modify it under --
|
12 |
|
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
13 |
|
|
-- ware Foundation; either version 3, or (at your option) any later ver- --
|
14 |
|
|
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
|
15 |
|
|
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
|
16 |
|
|
-- or FITNESS FOR A PARTICULAR PURPOSE. --
|
17 |
|
|
-- --
|
18 |
|
|
-- You should have received a copy of the GNU General Public License along --
|
19 |
|
|
-- with this program; see file COPYING3. If not see --
|
20 |
|
|
-- <http://www.gnu.org/licenses/>. --
|
21 |
|
|
-- --
|
22 |
|
|
-- GNAT was originally developed by the GNAT team at New York University. --
|
23 |
|
|
-- Extensive contributions were provided by Ada Core Technologies Inc. --
|
24 |
|
|
-- --
|
25 |
|
|
------------------------------------------------------------------------------
|
26 |
|
|
|
27 |
|
|
-- Expand routines for chapter 11 constructs
|
28 |
|
|
|
29 |
|
|
with Types; use Types;
|
30 |
|
|
|
31 |
|
|
package Exp_Ch11 is
|
32 |
|
|
procedure Expand_N_Exception_Declaration (N : Node_Id);
|
33 |
|
|
procedure Expand_N_Handled_Sequence_Of_Statements (N : Node_Id);
|
34 |
|
|
procedure Expand_N_Raise_Constraint_Error (N : Node_Id);
|
35 |
|
|
procedure Expand_N_Raise_Program_Error (N : Node_Id);
|
36 |
|
|
procedure Expand_N_Raise_Statement (N : Node_Id);
|
37 |
|
|
procedure Expand_N_Raise_Storage_Error (N : Node_Id);
|
38 |
|
|
procedure Expand_N_Subprogram_Info (N : Node_Id);
|
39 |
|
|
|
40 |
|
|
-- Data structures for gathering information to build exception tables
|
41 |
|
|
-- See runtime routine Ada.Exceptions for full details on the format and
|
42 |
|
|
-- content of these tables.
|
43 |
|
|
|
44 |
|
|
procedure Expand_At_End_Handler (HSS : Node_Id; Block : Node_Id);
|
45 |
|
|
-- Given a handled statement sequence, HSS, for which the At_End_Proc
|
46 |
|
|
-- field is set, and which currently has no exception handlers, this
|
47 |
|
|
-- procedure expands the special exception handler required.
|
48 |
|
|
-- This procedure also create a new scope for the given Block, if
|
49 |
|
|
-- Block is not Empty.
|
50 |
|
|
|
51 |
|
|
procedure Expand_Exception_Handlers (HSS : Node_Id);
|
52 |
|
|
-- This procedure expands exception handlers, and is called as part
|
53 |
|
|
-- of the processing for Expand_N_Handled_Sequence_Of_Statements and
|
54 |
|
|
-- is also called from Expand_At_End_Handler. N is the handled sequence
|
55 |
|
|
-- of statements that has the exception handler(s) to be expanded. This
|
56 |
|
|
-- is also called to expand the special exception handler built for
|
57 |
|
|
-- accept bodies (see Exp_Ch9.Build_Accept_Body).
|
58 |
|
|
|
59 |
|
|
function Find_Local_Handler
|
60 |
|
|
(Ename : Entity_Id;
|
61 |
|
|
Nod : Node_Id) return Node_Id;
|
62 |
|
|
-- This function searches for a local exception handler that will handle
|
63 |
|
|
-- the exception named by Ename. If such a local hander exists, then the
|
64 |
|
|
-- corresponding N_Exception_Handler is returned. If no such handler is
|
65 |
|
|
-- found then Empty is returned. In order to match and return True, the
|
66 |
|
|
-- handler may not have a choice parameter specification. Nod is the raise
|
67 |
|
|
-- node that references the handler.
|
68 |
|
|
|
69 |
|
|
function Get_Local_Raise_Call_Entity return Entity_Id;
|
70 |
|
|
-- This function is provided for use by the back end in conjunction with
|
71 |
|
|
-- generation of Local_Raise calls when an exception raise is converted to
|
72 |
|
|
-- a goto statement. If Local_Raise is defined, its entity is returned,
|
73 |
|
|
-- if not, Empty is returned (in which case the call is silently skipped).
|
74 |
|
|
|
75 |
|
|
function Get_RT_Exception_Entity (R : RT_Exception_Code) return Entity_Id;
|
76 |
|
|
-- This function is provided for use by the back end in conjunction with
|
77 |
|
|
-- generation of Local_Raise calls when an exception raise is converted to
|
78 |
|
|
-- a goto statement. The argument is the reason code which would be used
|
79 |
|
|
-- to determine which Rcheck_nn procedure to call. The returned result is
|
80 |
|
|
-- the exception entity to be passed to Local_Raise.
|
81 |
|
|
|
82 |
|
|
function Is_Non_Ada_Error (E : Entity_Id) return Boolean;
|
83 |
|
|
-- This function is provided for Gigi use. It returns True if operating on
|
84 |
|
|
-- VMS, and the argument E is the entity for System.Aux_Dec.Non_Ada_Error.
|
85 |
|
|
-- This is used to generate the special matching code for this exception.
|
86 |
|
|
|
87 |
|
|
procedure Possible_Local_Raise (N : Node_Id; E : Entity_Id);
|
88 |
|
|
-- This procedure is called whenever node N might cause the back end
|
89 |
|
|
-- to generate a local raise for a local Constraint/Program/Storage_Error
|
90 |
|
|
-- exception. It deals with generating a warning if there is no local
|
91 |
|
|
-- handler (and restriction No_Exception_Propagation is set), or if there
|
92 |
|
|
-- is a local handler marking that it has a local raise. E is the entity
|
93 |
|
|
-- of the corresponding exception.
|
94 |
|
|
|
95 |
|
|
end Exp_Ch11;
|