summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bearch.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-12-28 05:20:37 +0100
committerMatthias Braun <matze@braunis.de>2014-12-29 00:19:12 +0100
commita008ea3fe05b8fb1225b0a6bb5cb9ecc64afa812 (patch)
tree8439abc9c15dc757e5be80ce36019099676c46e8 /ir/be/bearch.c
parent002397085db3b03c915d99b99584ac300033a87c (diff)
bearch: introduce arch_find_register()
Diffstat (limited to 'ir/be/bearch.c')
-rw-r--r--ir/be/bearch.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ir/be/bearch.c b/ir/be/bearch.c
index 1829af7..6da2a99 100644
--- a/ir/be/bearch.c
+++ b/ir/be/bearch.c
@@ -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;