Updated header
[libfirm] / ir / st / exc.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /*
21  * Project:     libFIRM
22  * File name:   ir/st/exc.h
23  * Purpose:     Helper functions for jack exceptions.
24  * Author:      Florian Liekweg
25  * Modified by:
26  * Created:     4.3.2002
27  * CVS-ID:      $Id$
28  * Copyright:   (c) 2002-2003 Universität Karlsruhe
29  */
30
31
32 /**
33    NAME
34      exc
35    PURPOSE
36      Helper functions for exceptions
37    S
38      not quite complete
39 ***/
40
41 # include "irnode.h"
42
43 # ifndef _EXC_H_
44 # define _EXC_H_
45
46 # include "st.h"
47 # include "irop.h"
48 # include "irouts.h"
49
50 #include <stdbool.h>
51
52 #ifdef __cplusplus
53         extern "C" {
54 #endif
55
56 typedef enum {
57   exc_invalid = 0,                                      /* not yet computed */
58   exc_normal,                                   /* normal CF */
59
60   /* must push a new exc context at entry of block: */
61   exc_region,                                   /* region entry */
62
63   /* must pop current exc context at EXIT of block */
64   exc_exit,                                             /* region exit */
65
66   /* must pop current exc context at entry of block */
67   exc_handler,                                  /* handler entry */
68
69   exc_max                                               /* maximum value of enum for 'bounds checking' */
70 } exc_t;
71
72
73
74 const char *exc_to_string (exc_t);
75
76 bool is_handler_entry (ir_graph*, ir_node*);
77 bool is_region_entry  (ir_graph*, ir_node*);
78 bool is_handler_block (ir_graph*, ir_node*);
79 bool is_cont_entry    (ir_graph*, ir_node*);
80
81 void     set_Block_exc     (ir_node*, exc_t);
82 exc_t    get_Block_exc     (ir_node*);
83
84 void     set_Node_exc      (ir_node*, exc_t);
85 exc_t    get_Node_exc      (ir_node*);
86
87 /* handler handling  @@@ ajacs specific -- not supported  */
88 void     set_Block_handler (ir_node*, ir_node*);
89 ir_node* get_Block_handler (ir_node*);
90
91 void     set_Node_handler  (ir_node*, ir_node*);
92 ir_node* get_Node_handler  (ir_node*);
93
94 #ifdef __cplusplus
95 }
96 #endif
97
98 # endif /* def _EXC_H_ */