summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bearch.h
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2015-05-24 04:58:09 +0200
committerMatthias Braun <matze@braunis.de>2015-05-24 09:50:48 +0200
commit3e79d08e2fa64150e2a04132e5074370f0ff124f (patch)
tree1bff2543a27f78561056877de897716d40e52bee /ir/be/bearch.h
parent23f78db8dac1b070eba3cb75d7ec953a228a1286 (diff)
be: Move main backend loop into backends.
Instead of having a generaic main loop in be_main with several callbacks into the targets, split the code in be_main up into a set of convenience functions and let the targets implement the main loop itself. This is nicer because: - The control flow into and out of the functions in the target becomes obvious as no external party is using callbacks anymore. - Targets can insert custom code at any place between the generic passes. - In the future we can parameterize the generic backend passes directly instead of stuffing info into generic isa_if structures.
Diffstat (limited to 'ir/be/bearch.h')
-rw-r--r--ir/be/bearch.h34
1 files changed, 5 insertions, 29 deletions
diff --git a/ir/be/bearch.h b/ir/be/bearch.h
index 69b57c5..d109e26 100644
--- a/ir/be/bearch.h
+++ b/ir/be/bearch.h
@@ -325,6 +325,11 @@ struct arch_isa_if_t {
const backend_params *(*get_params)(void);
/**
+ * Generate code for the current firm program.
+ */
+ void (*generate_code)(FILE *output, const char *cup_name);
+
+ /**
* lowers current program for target. See the documentation for
* be_lower_for_target() for details.
*/
@@ -337,17 +342,6 @@ struct arch_isa_if_t {
int (*is_valid_clobber)(const char *clobber);
/**
- * Start codegeneration
- * @return a new isa instance
- */
- void (*begin_codegeneration)(void);
-
- /**
- * Free the isa instance.
- */
- void (*end_codegeneration)(void);
-
- /**
* mark node as rematerialized
*/
void (*mark_remat)(ir_node *node);
@@ -377,24 +371,6 @@ struct arch_isa_if_t {
* intrinsics here.
*/
void (*handle_intrinsics)(ir_graph *irg);
-
- /**
- * Initialize a graph for codegeneration. Code selection is usually
- * performed in this step.
- */
- void (*prepare_graph)(ir_graph *irg);
-
- /**
- * Called before register allocation.
- */
- void (*before_ra)(ir_graph *irg);
-
- /**
- * Last step in the backend. Called after register allocation.
- * May perform peephole optimizations and legalizations and finally emit
- * the code.
- */
- void (*emit)(ir_graph *irg);
};
static inline bool arch_irn_is_ignore(const ir_node *irn)