New implementation of tarval module
[libfirm] / ir / st / exc.h
1 /* Copyright (c) 2002 by Universität Karlsruhe (TH).  All Rights Reserved */
2 /*
3 * Time-stamp: <Thursday, 19.12.2002, 15:45:43 goetz@i44pc2.info.uni-karlsruhe.de>
4 */
5
6 /**
7    NAME
8      exc
9    PURPOSE
10      Helper functions for exceptions
11    S
12      not quite complete
13    HISTORY
14      liekweg - Mar 4, 2002: Created.
15    CVS:
16      $Id$
17 ***/
18
19 # include "irnode.h"
20
21 # ifndef _EXC_H_
22 # define _EXC_H_
23
24 # include "st.h"
25 # include "irop.h"
26 # include "irouts.h"
27
28 #include <stdbool.h>
29
30 typedef enum {
31   exc_invalid = 0,                                      /* not yet computed */
32   exc_normal,                                   /* normal CF */
33
34   /* must push a new exc context at entry of block: */
35   exc_region,                                   /* region entry */
36
37   /* must pop current exc context at EXIT of block */
38   exc_exit,                                             /* region exit */
39
40   /* must pop current exc context at entry of block */
41   exc_handler,                                  /* handler entry */
42
43   exc_max                                               /* maximum value of enum for 'bounds checking' */
44 } exc_t;
45
46 const char *exc_to_string (exc_t);
47
48 bool is_handler_entry (ir_graph*, ir_node*);
49 bool is_region_entry  (ir_graph*, ir_node*);
50 bool is_handler_block (ir_graph*, ir_node*);
51 bool is_cont_entry    (ir_graph*, ir_node*);
52
53 void     set_Block_exc     (ir_node*, exc_t);
54 exc_t    get_Block_exc     (ir_node*);
55
56 void     set_Node_exc      (ir_node*, exc_t);
57 exc_t    get_Node_exc      (ir_node*);
58
59 /* handler handling  @@@ ajacs specific -- not supported  */
60 void     set_Block_handler (ir_node*, ir_node*);
61 ir_node* get_Block_handler (ir_node*);
62
63 void     set_Node_handler  (ir_node*, ir_node*);
64 ir_node* get_Node_handler  (ir_node*);
65
66 # endif /* def _EXC_H_ */