summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bearch.c
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-27 20:37:53 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-27 21:15:42 +0200
commit8d14210e48e14de3b1d7bca00df590ca92700e0b (patch)
treec6657537705165b724bd831735fb80723f8edb49 /ir/be/bearch.c
parent4652701dd62546a5a9fbcafddb990784e3493631 (diff)
be: Give the none register requirement a register class.
Now register requirements always have have a register class. This is more consistent and removes some null pointer checks.
Diffstat (limited to 'ir/be/bearch.c')
-rw-r--r--ir/be/bearch.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ir/be/bearch.c b/ir/be/bearch.c
index 9cded6e..c48cb1b 100644
--- a/ir/be/bearch.c
+++ b/ir/be/bearch.c
@@ -19,8 +19,18 @@
#include "raw_bitset.h"
#include "util.h"
+static arch_register_class_t arch_none_cls = {
+ .name = "none",
+ .mode = NULL,
+ .regs = NULL,
+ .class_req = arch_no_register_req,
+ .index = (unsigned)-1,
+ .n_regs = 0,
+ .manual_ra = true,
+};
+
arch_register_req_t const arch_no_requirement = {
- .cls = NULL,
+ .cls = &arch_none_cls,
};
static reg_out_info_t *get_out_info_n(const ir_node *node, unsigned pos)
@@ -134,7 +144,7 @@ ir_node *be_get_start_proj(ir_graph *const irg, be_start_info_t *const info)
/* This is already the transformed start node. */
ir_node *const start = get_irg_start(irg);
arch_register_class_t const *const cls = arch_get_irn_register_req_out(start, info->pos)->cls;
- info->irn = new_r_Proj(start, cls ? cls->mode : mode_M, info->pos);
+ info->irn = new_r_Proj(start, cls->mode ? cls->mode : mode_M, info->pos);
}
return info->irn;
}