summaryrefslogtreecommitdiffhomepage
path: root/ir/be/benode.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/benode.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/benode.c')
-rw-r--r--ir/be/benode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ir/be/benode.c b/ir/be/benode.c
index 5309fbe..5daeae2 100644
--- a/ir/be/benode.c
+++ b/ir/be/benode.c
@@ -36,6 +36,7 @@
#include "pmap.h"
#include "raw_bitset.h"
#include "set.h"
+#include "target_t.h"
#include "util.h"
#include <stdlib.h>
@@ -474,7 +475,7 @@ ir_node *be_new_Start(ir_graph *const irg, be_start_out const *const outs)
{
ir_node *const block = get_irg_start_block(irg);
ir_node *const start = new_ir_node(NULL, irg, block, op_be_Start, mode_T, 0, NULL);
- unsigned const n_regs = isa_if->n_registers;
+ unsigned const n_regs = ir_target.isa->n_registers;
/* Count the number of outputs. */
unsigned k = 1; /* +1 for memory */
@@ -488,7 +489,7 @@ ir_node *be_new_Start(ir_graph *const irg, be_start_out const *const outs)
/* Set out requirements and registers. */
unsigned l = 0;
arch_set_irn_register_req_out(start, l++, arch_memory_req);
- arch_register_t const *const regs = isa_if->registers;
+ arch_register_t const *const regs = ir_target.isa->registers;
for (unsigned i = 0; i != n_regs; ++i) {
if (outs[i] != BE_START_NO) {
arch_register_t const *const reg = &regs[i];