summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bepeephole.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-01-04 20:12:21 +0100
committerMatthias Braun <matze@braunis.de>2017-02-20 04:48:18 +0100
commit1ffc842f8bb13ed098eeaf2382ba473f9e154466 (patch)
treecd4c1c9ca57400975db74b7212ac237166359704 /ir/be/bepeephole.c
parent845e655dac11bc5eba82b9fc6d36a6f4fec23eb6 (diff)
Rework target initialization and query
- Moves machine triple handling code form cparser into libfirm - Create new APIs to set the target and query information about it - Move backend_params into the new target API - Backends initialize ir_target instead of backend_params now - Add new API to get information about the target platform: - Mangle a name for the target platform (and remove compilerlib mangling callback) - Can query size and alignment of basic C types for the platform - Move some constant target information into arch_isa_if_t (we move it to target_info_t later when we realize it needs to be dynamic) - Redo backend initialization. Examples: Simple case: Initialize for host: ir_init(); Complex case: cross-compile to sparc with PIC enabled: ir_init_library(); ir_target_set("sparc-leon-linux-gnu"); ir_target_option("pic"); ir_target_init();
Diffstat (limited to 'ir/be/bepeephole.c')
-rw-r--r--ir/be/bepeephole.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ir/be/bepeephole.c b/ir/be/bepeephole.c
index 8ebf590..f4775d4 100644
--- a/ir/be/bepeephole.c
+++ b/ir/be/bepeephole.c
@@ -23,6 +23,7 @@
#include "irgmod.h"
#include "irgwalk.h"
#include "panic.h"
+#include "target_t.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
@@ -161,7 +162,7 @@ static void process_block(ir_node *block, void *data)
(void)data;
/* construct initial register assignment */
- memset(register_values, 0, sizeof(ir_node*) * isa_if->n_registers);
+ memset(register_values, 0, sizeof(ir_node*) * ir_target.isa->n_registers);
DB((dbg, LEVEL_1, "\nProcessing block %+F (from end)\n", block));
be_lv_foreach(lv, block, be_lv_state_end, node) {
@@ -405,7 +406,7 @@ void be_peephole_opt(ir_graph *irg)
lv = be_get_irg_liveness(irg);
- register_values = XMALLOCN(ir_node*, isa_if->n_registers);
+ register_values = XMALLOCN(ir_node*, ir_target.isa->n_registers);
irg_block_walk_graph(irg, process_block, NULL, NULL);