#include "bearch.h"
#include "ircons_t.h"
+#include "irnode_t.h"
#include "bitset.h"
#include "pset.h"
#include "entity.h"
-arch_env_t *arch_env_init(arch_env_t *env, const arch_isa_if_t *isa_if)
+#include "irprintf.h"
+
+/* Initialize the architecture environment struct. */
+arch_env_t *arch_env_init(arch_env_t *env, const arch_isa_if_t *isa_if, FILE *file_handle)
{
memset(env, 0, sizeof(*env));
- env->isa = isa_if->init();
+ env->isa = isa_if->init(file_handle);
return env;
}
-arch_env_t *arch_env_add_irn_handler(arch_env_t *env,
+arch_env_t *arch_env_push_irn_handler(arch_env_t *env,
const arch_irn_handler_t *handler)
{
assert(env->handlers_tos <= ARCH_MAX_HANDLERS);
return env;
}
+const arch_irn_handler_t *arch_env_pop_irn_handler(arch_env_t *env)
+{
+ assert(env->handlers_tos > 0 && env->handlers_tos <= ARCH_MAX_HANDLERS);
+ return env->handlers[--env->handlers_tos];
+}
+
static const arch_irn_ops_t *fallback_irn_ops = NULL;
int arch_register_class_put(const arch_register_class_t *cls, bitset_t *bs)
return ops->impl->get_irn_reg_req(ops, req, irn, pos);
}
-void arch_set_stack_bias(const arch_env_t *env, ir_node *irn, int bias)
+void arch_set_frame_offset(const arch_env_t *env, ir_node *irn, int offset)
{
const arch_irn_ops_t *ops = get_irn_ops(env, irn);
- ops->impl->set_stack_bias(ops, irn, bias);
+ ops->impl->set_frame_offset(ops, irn, offset);
}
entity *arch_get_frame_entity(const arch_env_t *env, ir_node *irn)
XXX(dont_spill);
XXX(ignore);
XXX(rematerializable);
+ XXX(modify_sp);
XXX(none);
#undef XXX
}
}
if(arch_register_req_is(req, should_be_same)) {
- snprintf(tmp, sizeof(tmp), " same to: %+F", req->other_different);
+ ir_snprintf(tmp, sizeof(tmp), " same to: %+F", req->other_different);
strncat(buf, tmp, len);
}
if(arch_register_req_is(req, should_be_different)) {
- snprintf(tmp, sizeof(tmp), " different to: %+F", req->other_different);
+ ir_snprintf(tmp, sizeof(tmp), " different to: %+F", req->other_different);
strncat(buf, tmp, len);
}