+/**
+ * Check, if a register is assignable to an operand of a node.
+ * @param env The architecture environment.
+ * @param irn The node.
+ * @param pos The position of the operand.
+ * @param reg The register.
+ * @return 1, if the register might be allocated to the operand 0 if not.
+ */
+extern int arch_reg_is_allocatable(const arch_env_t *env,
+ const ir_node *irn, int pos, const arch_register_t *reg);
+
+/**
+ * Get the register class of an operand of a node.
+ * @param env The architecture environment.
+ * @param irn The node.
+ * @param pos The position of the operand.
+ * @return The register class of the operand or NULL, if
+ * operand is a non-register operand.
+ */
+extern const arch_register_class_t *
+arch_get_irn_reg_class(const arch_env_t *env, const ir_node *irn, int pos);
+
+/**
+ * Get the register allocated at a certain output operand of a node.
+ * @param env The arch environment.
+ * @param irn The node.
+ * @return The register allocated for this operand
+ */
+extern const arch_register_t *
+arch_get_irn_register(const arch_env_t *env, const ir_node *irn);
+
+/**
+ * Set the register for a certain output operand.
+ * @param env The architecture environment.
+ * @param irn The node.
+ * @param idx The index of the output operand.
+ * @param reg The register.
+ */
+extern void arch_set_irn_register(const arch_env_t *env, ir_node *irn,
+ const arch_register_t *reg);
+
+/**
+ * Classify a node.
+ * @param env The architecture environment.
+ * @param irn The node.
+ * @return A classification of the node.
+ */
+extern arch_irn_class_t arch_irn_classify(const arch_env_t *env, const ir_node *irn);
+
+/**
+ * Get the flags of a node.
+ * @param env The architecture environment.
+ * @param irn The node.
+ * @return The flags.
+ */
+extern arch_irn_flags_t arch_irn_get_flags(const arch_env_t *env, const ir_node *irn);
+
+#define arch_irn_is_ignore(env, irn) ((arch_irn_get_flags(env, irn) & arch_irn_flags_ignore) != 0)
+
+#define arch_irn_has_reg_class(env, irn, pos, cls) \
+ ((cls) == arch_get_irn_reg_class(env, irn, pos))
+
+#define arch_irn_consider_in_reg_alloc(env, cls, irn) \
+ (arch_irn_has_reg_class(env, irn, -1, cls) && !arch_irn_is_ignore(env, irn))
+
+/**
+ * Somebody who can be asked about nodes.
+ */
+struct _arch_irn_handler_t {
+
+ /**
+ * Get the operations of an irn.
+ * @param self The handler from which the method is invoked.
+ * @param irn Some node.
+ * @return Operations for that irn.
+ */
+ const void *(*get_irn_ops)(const arch_irn_handler_t *handler,
+ const ir_node *irn);
+
+};
+
+/**
+ * The code generator.
+ */
+struct _arch_code_generator_if_t {
+
+
+ /**
+ * Initialize the code generator.
+ * @param file The file to dump to.
+ * @param birg A backend IRG session.
+ * @return A newly created code generator.
+ */
+ void *(*init)(FILE *file, const be_irg_t *birg);
+
+ /**
+ * Called, when the graph is being normalized.
+ */
+ void (*prepare_graph)(void *self);
+
+ /**
+ * Called before scheduling.
+ */
+ void (*before_sched)(void *self);
+
+ /**
+ * Called before register allocation.
+ */
+ 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.
+ */
+ void (*done)(void *self);
+
+};
+
+#define _arch_cg_call(cg, func) \
+do { \
+ if((cg)->impl->func) \
+ (cg)->impl->func(cg); \
+} while(0)
+
+#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)
+
+/**
+ * Code generator base class.
+ */
+struct _arch_code_generator_t {
+ const arch_code_generator_if_t *impl;
+};
+
+/**
+ * ISA base class.
+ */
+struct _arch_isa_t {
+ const arch_isa_if_t *impl;
+ const arch_register_t *sp; /** The stack pointer register. */
+ const arch_register_t *bp; /** The base pointer register. */
+ const int stack_dir; /** -1 for decreasing, 1 for increasing. */
+};
+
+#define arch_isa_stack_dir(isa) ((isa)->stack_dir)
+#define arch_isa_sp(isa) ((isa)->sp)
+#define arch_isa_bp(isa) ((isa)->bp)
+
+/**
+ * Architecture interface.
+ */
+struct _arch_isa_if_t {
+
+#ifdef WITH_LIBCORE
+ void (*register_options)(lc_opt_entry_t *grp);