firm_debug_break() is now public
[libfirm] / ir / st / exc.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/st/exc.h
4  * Purpose:     Helper functions for jack exceptions.
5  * Author:      Florian Liekweg
6  * Modified by:
7  * Created:     4.3.2002
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2002-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13
14 /**
15    NAME
16      exc
17    PURPOSE
18      Helper functions for exceptions
19    S
20      not quite complete
21 ***/
22
23 # include "irnode.h"
24
25 # ifndef _EXC_H_
26 # define _EXC_H_
27
28 # include "st.h"
29 # include "irop.h"
30 # include "irouts.h"
31
32 #include <stdbool.h>
33
34 #ifdef __cplusplus
35         extern "C" {
36 #endif
37
38 typedef enum {
39   exc_invalid = 0,                                      /* not yet computed */
40   exc_normal,                                   /* normal CF */
41
42   /* must push a new exc context at entry of block: */
43   exc_region,                                   /* region entry */
44
45   /* must pop current exc context at EXIT of block */
46   exc_exit,                                             /* region exit */
47
48   /* must pop current exc context at entry of block */
49   exc_handler,                                  /* handler entry */
50
51   exc_max                                               /* maximum value of enum for 'bounds checking' */
52 } exc_t;
53
54
55
56 const char *exc_to_string (exc_t);
57
58 bool is_handler_entry (ir_graph*, ir_node*);
59 bool is_region_entry  (ir_graph*, ir_node*);
60 bool is_handler_block (ir_graph*, ir_node*);
61 bool is_cont_entry    (ir_graph*, ir_node*);
62
63 void     set_Block_exc     (ir_node*, exc_t);
64 exc_t    get_Block_exc     (ir_node*);
65
66 void     set_Node_exc      (ir_node*, exc_t);
67 exc_t    get_Node_exc      (ir_node*);
68
69 /* handler handling  @@@ ajacs specific -- not supported  */
70 void     set_Block_handler (ir_node*, ir_node*);
71 ir_node* get_Block_handler (ir_node*);
72
73 void     set_Node_handler  (ir_node*, ir_node*);
74 ir_node* get_Node_handler  (ir_node*);
75
76 #ifdef __cplusplus
77 }
78 #endif
79
80 # endif /* def _EXC_H_ */