#include "besched.h"
#include "beirg.h"
#include "bessaconstr.h"
+#include "bemodule.h"
+
+DEBUG_ONLY(static firm_dbg_module_t *dbg;)
typedef struct _be_abi_call_arg_t {
unsigned is_res : 1; /**< 1: the call argument is a return value. 0: it's a call parameter. */
arch_register_req_t *sp_req;
be_stack_layout_t frame; /**< The stack frame model. */
-
- DEBUG_ONLY(firm_dbg_module_t *dbg;) /**< The debugging module. */
};
static heights_t *ir_heights;
return frame;
}
-#if 0
-/** Dumps the stack layout to file. */
-static void stack_layout_dump(FILE *file, be_stack_layout_t *frame)
-{
- int i, j, n;
-
- ir_fprintf(file, "initial offset: %d\n", frame->initial_offset);
- for (j = 0; j < N_FRAME_TYPES; ++j) {
- ir_type *t = frame->order[j];
-
- ir_fprintf(file, "type %d: %F size: %d\n", j, t, get_type_size_bytes(t));
- for (i = 0, n = get_compound_n_members(t); i < n; ++i) {
- ir_entity *ent = get_compound_member(t, i);
- ir_fprintf(file, "\t%F int ofs: %d glob ofs: %d\n", ent, get_entity_offset_bytes(ent), get_stack_entity_offset(frame, ent, 0));
- }
- }
-}
-#endif
-
/**
* Returns non-zero if the call argument at given position
* is transfered on the stack.
*/
be_node_set_reg_class_in(low_call, be_pos_Call_ptr, call->cls_addr);
- DBG((env->dbg, LEVEL_3, "\tcreated backend call %+F\n", low_call));
+ DBG((dbg, LEVEL_3, "\tcreated backend call %+F\n", low_call));
/* Set the register classes and constraints of the Call parameters. */
for (i = 0; i < n_reg_params; ++i) {
for (i = n - 1; i >= 0; --i) {
ir_node *irn = nodes[i];
- DBG((env->dbg, LEVEL_3, "\tprocessing call %+F\n", irn));
+ DBG((dbg, LEVEL_3, "\tprocessing call %+F\n", irn));
switch (get_irn_opcode(irn)) {
case iro_Call:
if (! be_omit_fp) {
ent_pos_pair *entry, *new_list;
ir_type *frame_tp;
int i, n = ARR_LEN(value_param_list);
- DEBUG_ONLY(firm_dbg_module_t *dbg = env->dbg;)
new_list = NULL;
for (i = 0; i < n; ++i) {
lower_frame_sels_env_t ctx;
ir_entity **param_map;
- DEBUG_ONLY(firm_dbg_module_t *dbg = env->dbg;)
-
DBG((dbg, LEVEL_1, "introducing abi on %+F\n", irg));
/* Must fetch memory here, otherwise the start Barrier gets the wrong
env->init_sp = dummy = new_r_Unknown(irg, env->arch_env->sp->reg_class->mode);
restore_optimization_state(&state);
- FIRM_DBG_REGISTER(env->dbg, "firm.be.abi");
-
env->calls = NEW_ARR_F(ir_node*, 0);
if (birg->main_env->options->pic) {
int bias = omit_fp ? real_bias : 0;
int offset = get_stack_entity_offset(&env->frame, ent, bias);
arch_set_frame_offset(irn, offset);
- DBG((env->dbg, LEVEL_2, "%F has offset %d (including bias %d)\n",
+ DBG((dbg, LEVEL_2, "%F has offset %d (including bias %d)\n",
ent, offset, bias));
}
{
return abi->call->flags.bits.try_omit_fp;
}
+
+void be_init_abi(void)
+{
+ FIRM_DBG_REGISTER(dbg, "firm.be.abi");
+}
+
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_abi);