8aaf9b0eedda5f63082b2f7f7a8a2f898e2ffc2a
[libfirm] / ir / be / be_t.h
1 /**
2  * Internal backend global data structures.
3  * @author Sebastian Hack
4  * @date 8.12.2004
5  */
6
7 #ifndef _BE_T_H
8 #define _BE_T_H
9
10 #include "firm_types.h"
11 #include "obst.h"
12 #include "debug.h"
13 #include "bitset.h"
14
15 #include "be.h"
16 #include "bearch.h"
17 #include "beirgmod.h"
18
19 #define DUMP_NONE       0
20 #define DUMP_INITIAL    (1 << 0)
21 #define DUMP_ABI        (1 << 1)
22 #define DUMP_SCHED      (1 << 2)
23 #define DUMP_PREPARED   (1 << 3)
24 #define DUMP_RA         (1 << 4)
25 #define DUMP_FINAL      (1 << 5)
26 #define DUMP_BE         (1 << 6)
27
28 enum {
29         BE_TIME_OFF,
30         BE_TIME_ON
31 };
32
33 enum {
34         BE_VRFY_OFF,
35         BE_VRFY_WARN,
36         BE_VRFY_ASSERT
37 };
38
39 enum {
40         BE_SCHED_SELECT_ISA      = 0,
41         BE_SCHED_SELECT_MUCHNIK  = 1,
42         BE_SCHED_SELECT_HEUR     = 2,
43         BE_SCHED_SELECT_HMUCHNIK = 3
44 };
45
46 struct _be_options_t {
47         int  dump_flags;
48         int  timing;
49         int  sched_select;
50         int  mris;
51         char ilp_server[128];
52         char ilp_solver[128];
53 };
54
55 struct _be_main_env_t {
56   struct obstack obst;
57   struct _be_node_factory_t *node_factory;
58   struct _arch_env_t *arch_env;
59   struct _be_options_t *options;
60   struct _arch_code_generator_t *cg;
61   struct _arch_irn_handler_t *phi_handler;
62   DEBUG_ONLY(firm_dbg_module_t *dbg;)
63 };
64
65 struct _be_irg_t {
66         ir_graph                      *irg;
67         struct _be_main_env_t         *main_env;
68         struct _be_abi_irg_t          *abi;
69         struct _arch_code_generator_t *cg;
70 };
71
72 /**
73 * Put the registers to be ignored in this IRG into a bitset.
74 * @param birg The backend IRG data structure.
75 * @param cls  The register class.
76 * @param bs   The bitset (may be NULL).
77 * @return The number of registers to be ignored.
78 */
79 int be_put_ignore_regs(const struct _be_irg_t *birg, const struct _arch_register_class_t *cls, bitset_t *bs);
80
81
82
83 #endif /* _BE_T_H */