fixed some minor bugs
[libfirm] / ir / be / bearch.h
index 09c2783..743b906 100644 (file)
@@ -1,42 +1,21 @@
 #ifndef _FIRM_BEARCH_H
 #define _FIRM_BEARCH_H
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
+#include "firm_config.h"
 
 #ifdef WITH_LIBCORE
 #include <libcore/lc_opts.h>
 #endif
 
-#include "type.h"
-
-#include "irnode.h"
-#include "irmode.h"
+#include "firm_types.h"
 
 #include "bitset.h"
-#include "hashptr.h"
-#include "fourcc.h"
-#include "set.h"
-#include "list.h"
-#include "ident.h"
 
 #include "belistsched.h"
 #include "beabi_t.h"
+#include "bearch_t.h"
 #include "be_t.h"
 
-typedef struct _arch_register_class_t     arch_register_class_t;
-typedef struct _arch_register_t           arch_register_t;
-typedef struct _arch_isa_if_t             arch_isa_if_t;
-typedef struct _arch_isa_t                arch_isa_t;
-typedef struct _arch_env_t                arch_env_t;
-typedef struct _arch_irn_ops_if_t         arch_irn_ops_if_t;
-typedef struct _arch_irn_ops_t            arch_irn_ops_t;
-typedef struct _arch_irn_handler_t        arch_irn_handler_t;
-typedef struct _arch_code_generator_t     arch_code_generator_t;
-typedef struct _arch_code_generator_if_t  arch_code_generator_if_t;
-
 struct _be_node_factory_t;
 
 typedef enum _arch_register_type_t {
@@ -441,6 +420,11 @@ struct _arch_code_generator_if_t {
         */
        void *(*init)(FILE *file, const be_irg_t *birg);
 
+       /**
+        * Called before abi introduce.
+        */
+       void (*before_abi)(void *self);
+
        /**
         * Called, when the graph is being normalized.
         */
@@ -456,6 +440,11 @@ struct _arch_code_generator_if_t {
         */
        void (*before_ra)(void *self);
 
+       /**
+        * Called after register allocation.
+        */
+       void (*after_ra)(void *self);
+
        /**
         * Called after everything happened.
         * The code generator must also be de-allocated here.
@@ -470,9 +459,11 @@ do { \
                (cg)->impl->func(cg); \
 } while(0)
 
+#define arch_code_generator_before_abi(cg)      _arch_cg_call(cg, before_abi)
 #define arch_code_generator_prepare_graph(cg)   _arch_cg_call(cg, prepare_graph)
 #define arch_code_generator_before_sched(cg)    _arch_cg_call(cg, before_sched)
 #define arch_code_generator_before_ra(cg)       _arch_cg_call(cg, before_ra)
+#define arch_code_generator_after_ra(cg)        _arch_cg_call(cg, after_ra)
 #define arch_code_generator_done(cg)            _arch_cg_call(cg, done)
 
 /**