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
18 #include "firm_types.h"
24 DUMP_INITIAL = 1 << 0,
27 DUMP_PREPARED = 1 << 3,
44 /** Backend options */
46 unsigned dump_flags; /**< backend dumping flags */
47 int timing; /**< time the backend phases */
48 int opt_profile_generate; /**< instrument code for profiling */
49 int opt_profile_use; /**< use existing profile data */
50 int omit_fp; /**< try to omit the frame pointer */
51 int pic; /**< create position independent code */
52 int verify_option; /**< backend verify option */
53 char ilp_server[128]; /**< the ilp server name */
54 char ilp_solver[128]; /**< the ilp solver name */
55 int statev; /**< enable stat event dumping */
56 char filtev[128]; /**< filter mask for stat events */
57 int verbose_asm; /**< dump verbose assembler */
59 extern be_options_t be_options;
61 struct be_main_env_t {
63 const char *cup_name; /**< name of the compilation unit */
64 pmap *ent_trampoline_map; /**< A map containing PIC trampolines for methods. */
65 ir_type *pic_trampolines_type; /**< Class type containing all trampolines */
66 pmap *ent_pic_symbol_map;
67 ir_type *pic_symbols_type;
70 extern asm_constraint_flags_t asm_constraint_flags[256];
72 void be_init_default_asm_constraint_flags(void);
74 void be_get_allocatable_regs(ir_graph const *irg, arch_register_class_t const *cls, unsigned *raw_bitset);
76 unsigned be_get_n_allocatable_regs(const ir_graph *irg,
77 const arch_register_class_t *cls);
80 * Initialize the backend. Must be run first in init_firm();
82 void firm_be_init(void);
83 void firm_be_finish(void);
113 ENUM_COUNTABLE(be_timer_id_t)
114 extern ir_timer_t *be_timers[T_LAST+1];
116 static inline void be_timer_push(be_timer_id_t id)
118 assert(id <= T_LAST);
121 ir_timer_push(be_timers[id]);
124 static inline void be_timer_pop(be_timer_id_t id)
126 assert(id <= T_LAST);
129 ir_timer_pop(be_timers[id]);