Commit a008ea3f authored by Matthias Braun's avatar Matthias Braun
Browse files

bearch: introduce arch_find_register()

parent 00239708
......@@ -108,6 +108,17 @@ bool arch_reg_is_allocatable(const arch_register_req_t *req,
return true;
}
const arch_register_t *arch_find_register(const arch_env_t *arch_env,
const char *name)
{
for (size_t i = 0, n = arch_env->n_registers; i < n; ++i) {
const arch_register_t *reg = &arch_env->registers[i];
if (strcmp(reg->name, name) == 0)
return reg;
}
return NULL;
}
void be_make_start_mem(be_start_info_t *const info, ir_node *const start, unsigned const pos)
{
info->pos = pos;
......
......@@ -425,6 +425,9 @@ static inline bool arch_irn_consider_in_reg_alloc(
return req->cls == cls && !arch_register_req_is(req, ignore);
}
const arch_register_t *arch_find_register(const arch_env_t *arch_env,
const char *name);
#define be_foreach_value(node, value, code) \
do { \
if (get_irn_mode(node) == mode_T) { \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment