2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief Internal backend global data structures.
9 * @author Sebastian Hack
11 #ifndef FIRM_BE_BE_T_H
12 #define FIRM_BE_BE_T_H
17 #include "firm_types.h"
23 DUMP_INITIAL = 1 << 0,
26 DUMP_PREPARED = 1 << 3,
43 /** Backend options */
45 unsigned dump_flags; /**< backend dumping flags */
46 int timing; /**< time the backend phases */
47 int opt_profile_generate; /**< instrument code for profiling */
48 int opt_profile_use; /**< use existing profile data */
49 int omit_fp; /**< try to omit the frame pointer */
50 int pic; /**< create position independent code */
51 int verify_option; /**< backend verify option */
52 char ilp_server[128]; /**< the ilp server name */
53 char ilp_solver[128]; /**< the ilp solver name */
54 int statev; /**< enable stat event dumping */
55 char filtev[128]; /**< filter mask for stat events */
56 int verbose_asm; /**< dump verbose assembler */
58 extern be_options_t be_options;
60 struct be_main_env_t {
62 const char *cup_name; /**< name of the compilation unit */
63 pmap *ent_trampoline_map; /**< A map containing PIC trampolines for methods. */
64 ir_type *pic_trampolines_type; /**< Class type containing all trampolines */
65 pmap *ent_pic_symbol_map;
66 ir_type *pic_symbols_type;
69 extern asm_constraint_flags_t asm_constraint_flags[256];
71 void be_init_default_asm_constraint_flags(void);
73 void be_put_allocatable_regs(const ir_graph *irg,
74 const arch_register_class_t *cls, bitset_t *bs);
76 void be_set_allocatable_regs(const ir_graph *irg,
77 const arch_register_class_t *cls,
78 unsigned *raw_bitset);
80 unsigned be_get_n_allocatable_regs(const ir_graph *irg,
81 const arch_register_class_t *cls);
84 * Initialize the backend. Must be run first in init_firm();
86 void firm_be_init(void);
87 void firm_be_finish(void);
117 ENUM_COUNTABLE(be_timer_id_t)
118 extern ir_timer_t *be_timers[T_LAST+1];
120 static inline void be_timer_push(be_timer_id_t id)
122 assert(id <= T_LAST);
125 ir_timer_push(be_timers[id]);
128 static inline void be_timer_pop(be_timer_id_t id)
130 assert(id <= T_LAST);
133 ir_timer_pop(be_timers[id]);