analyse array types better
[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 typedef enum {
35   exc_invalid = 0,                                      /* not yet computed */
36   exc_normal,                                   /* normal CF */
37
38   /* must push a new exc context at entry of block: */
39   exc_region,                                   /* region entry */
40
41   /* must pop current exc context at EXIT of block */
42   exc_exit,                                             /* region exit */
43
44   /* must pop current exc context at entry of block */
45   exc_handler,                                  /* handler entry */
46
47   exc_max                                               /* maximum value of enum for 'bounds checking' */
48 } exc_t;
49
50 const char *exc_to_string (exc_t);
51
52 bool is_handler_entry (ir_graph*, ir_node*);
53 bool is_region_entry  (ir_graph*, ir_node*);
54 bool is_handler_block (ir_graph*, ir_node*);
55 bool is_cont_entry    (ir_graph*, ir_node*);
56
57 void     set_Block_exc     (ir_node*, exc_t);
58 exc_t    get_Block_exc     (ir_node*);
59
60 void     set_Node_exc      (ir_node*, exc_t);
61 exc_t    get_Node_exc      (ir_node*);
62
63 /* handler handling  @@@ ajacs specific -- not supported  */
64 void     set_Block_handler (ir_node*, ir_node*);
65 ir_node* get_Block_handler (ir_node*);
66
67 void     set_Node_handler  (ir_node*, ir_node*);
68 ir_node* get_Node_handler  (ir_node*);
69
70 # endif /* def _EXC_H_ */