summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bearch.h
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/bearch.h
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/bearch.h')
-rw-r--r--ir/be/bearch.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/ir/be/bearch.h b/ir/be/bearch.h
index c040dca..37544d5 100644
--- a/ir/be/bearch.h
+++ b/ir/be/bearch.h
@@ -159,11 +159,6 @@ static inline unsigned arch_get_irn_n_outs(const ir_node *node)
for (unsigned i = 0, i##__n = arch_get_irn_n_outs(node); i != i##__n; ++i)
/**
- * Register an instruction set architecture
- */
-void be_register_isa_if(const char *name, const arch_isa_if_t *isa);
-
-/**
* A register.
*/
struct arch_register_t {
@@ -262,6 +257,15 @@ static inline bool reg_req_has_constraint(const arch_register_req_t *req)
* Architecture interface.
*/
struct arch_isa_if_t {
+ char const *name;
+ uint8_t pointer_size; /**< Pointer size in bytes */
+ uint16_t modulo_shift; /**< Target modulo shift value */
+ bool big_endian; /**< Target is big endian */
+ uint8_t po2_biggest_alignment; /**< power of 2 of biggest alignment
+ necessary/recommended for any data
+ type on the target. */
+ bool pic_supported;
+
unsigned n_registers; /**< number of registers */
arch_register_t const *registers; /**< register array */
unsigned n_register_classes; /**< number of register classes */
@@ -269,7 +273,8 @@ struct arch_isa_if_t {
/**
* Initializes the isa interface. This is necessary before calling any
- * other functions from this interface.
+ * other functions from this interface. Also initializes the target
+ * information in ir_target.
*/
void (*init)(void);
@@ -279,11 +284,6 @@ struct arch_isa_if_t {
void (*finish)(void);
/**
- * Returns the frontend settings needed for this backend.
- */
- const backend_params *(*get_params)(void);
-
- /**
* Generate code for the current firm program.
*/
void (*generate_code)(FILE *output, const char *cup_name);