Commit 205396c4 authored by Matthias Braun's avatar Matthias Braun
Browse files

- Split bearch.h correctly into bearch.h and bearch_t.h

- Started working on flags

[r12716]
parent d16d39df
......@@ -5,7 +5,7 @@
#include "irnode.h"
#include "debug.h"
#include "../bearch.h"
#include "../bearch_t.h"
#include "../beemitter.h"
#include "bearch_TEMPLATE_t.h"
......
......@@ -4,7 +4,7 @@
#include "irnode.h"
#include "set.h"
#include "../bearch.h"
#include "../bearch_t.h"
#include "TEMPLATE_nodes_attr.h"
int TEMPLATE_cmp_irn_reg_assoc(const void *a, const void *b, size_t len);
......
......@@ -21,7 +21,7 @@
#include "irprintf.h"
#include "xmalloc.h"
#include "../bearch.h"
#include "../bearch_t.h"
#include "TEMPLATE_nodes_attr.h"
#include "TEMPLATE_new_nodes.h"
......
#ifndef _TEMPLATE_NODES_ATTR_H_
#define _TEMPLATE_NODES_ATTR_H_
#include "../bearch.h"
#include "../bearch_t.h"
typedef struct _TEMPLATE_attr_t {
arch_irn_flags_t flags; /**< indicating if spillable, rematerializeable ... etc. */
......
......@@ -14,7 +14,7 @@
#include "bitset.h"
#include "debug.h"
#include "../bearch.h" /* the general register allocator interface */
#include "../bearch_t.h" /* the general register allocator interface */
#include "../benode_t.h"
#include "../belower.h"
#include "../besched_t.h"
......@@ -291,13 +291,14 @@ static const arch_code_generator_if_t TEMPLATE_code_gen_if = {
* Initializes the code generator.
*/
static void *TEMPLATE_cg_init(be_irg_t *birg) {
TEMPLATE_isa_t *isa = (TEMPLATE_isa_t *)birg->main_env->arch_env->isa;
TEMPLATE_code_gen_t *cg = xmalloc(sizeof(*cg));
const arch_env_t *arch_env = be_get_birg_arch_env(birg);
TEMPLATE_isa_t *isa = (TEMPLATE_isa_t *) arch_env->isa;
TEMPLATE_code_gen_t *cg = xmalloc(sizeof(*cg));
cg->impl = &TEMPLATE_code_gen_if;
cg->irg = birg->irg;
cg->irg = be_get_birg_irg(birg);
cg->reg_set = new_set(TEMPLATE_cmp_irn_reg_assoc, 1024);
cg->arch_env = birg->main_env->arch_env;
cg->arch_env = arch_env;
cg->isa = isa;
cg->birg = birg;
FIRM_DBG_REGISTER(cg->mod, "firm.be.TEMPLATE.cg");
......
#ifndef _BEARCH_TEMPLATE_H_
#define _BEARCH_TEMPLATE_H_
#include "../bearch.h"
#include "../bearch_t.h"
extern const arch_isa_if_t TEMPLATE_isa_if;
......
......@@ -20,6 +20,7 @@
#include "../besched.h"
#include "../beblocksched.h"
#include "../beirg_t.h"
#include "arm_emitter.h"
#include "gen_arm_emitter.h"
......
......@@ -5,7 +5,7 @@
#include "irargs_t.h"
#include "debug.h"
#include "../bearch.h"
#include "../bearch_t.h"
#include "bearch_arm_t.h"
......
......@@ -10,7 +10,7 @@
#include "../bearch.h"
#include "../bearch_t.h"
#include "arm_nodes_attr.h"
......
......@@ -21,7 +21,7 @@
#include "irprintf.h"
#include "xmalloc.h"
#include "../bearch.h"
#include "../bearch_t.h"
#include "arm_nodes_attr.h"
#include "arm_new_nodes.h"
......
#ifndef _ARM_NODES_ATTR_H_
#define _ARM_NODES_ATTR_H_
#include "../bearch.h"
#include "../bearch_t.h"
#include "../../common/firm_types.h"
/**
......
......@@ -19,7 +19,7 @@
#include "bitset.h"
#include "debug.h"
#include "../bearch.h" /* the general register allocator interface */
#include "../bearch_t.h" /* the general register allocator interface */
#include "../benode_t.h"
#include "../belower.h"
#include "../besched_t.h"
......@@ -28,6 +28,7 @@
#include "../bemachine.h"
#include "../beilpsched.h"
#include "../bemodule.h"
#include "../beirg_t.h"
#include "bearch_arm_t.h"
......
#ifndef _BEARCH_ARM_H_
#define _BEARCH_ARM_H_
#include "../bearch.h"
#include "../bearch_t.h"
extern const arch_isa_if_t arm_isa_if;
......
......@@ -74,7 +74,7 @@ void be_set_debug_retrieve(retrieve_dbg_func func);
*/
const char *be_retrieve_dbg_info(const dbg_info *dbg, unsigned *line);
typedef struct _be_main_env_t be_main_env_t;
typedef struct _be_options_t be_options_t;
typedef struct be_main_env_t be_main_env_t;
typedef struct be_options_t be_options_t;
#endif /* _BE_MAIN_H */
......@@ -4,8 +4,8 @@
* @date 8.12.2004
*/
#ifndef _BE_T_H
#define _BE_T_H
#ifndef FIRM_BE_T_H
#define FIRM_BE_T_H
#include "firm_types.h"
#include "obst.h"
......@@ -15,7 +15,7 @@
#include "be.h"
#include "bearch.h"
#include "be_dbgout.h"
#include "beirg_t.h"
#include "beirg.h"
#define DUMP_NONE 0
#define DUMP_INITIAL (1 << 0)
......@@ -43,7 +43,7 @@ enum {
};
/** Backend options */
struct _be_options_t {
struct be_options_t {
unsigned dump_flags; /**< backend dumping flags */
int timing; /**< time the backend phases */
int opt_profile; /**< instrument code for profiling */
......@@ -56,14 +56,13 @@ struct _be_options_t {
char stat_file_name[256]; /**< name of the file where the statistics are put to */
};
struct _be_main_env_t {
struct obstack obst;
struct _arch_env_t *arch_env;
struct _be_options_t *options;
struct _arch_code_generator_t *cg;
struct _arch_irn_handler_t *phi_handler;
dbg_handle *db_handle;
DEBUG_ONLY(firm_dbg_module_t *dbg;)
struct be_main_env_t {
struct obstack obst;
arch_env_t *arch_env;
be_options_t *options;
arch_code_generator_t *cg;
arch_irn_handler_t *phi_handler;
dbg_handle *db_handle;
};
/**
......@@ -73,8 +72,7 @@ struct _be_main_env_t {
* @param bs The bitset (may be NULL).
* @return The number of registers to be ignored.
*/
int be_put_ignore_regs(const struct _be_irg_t *birg, const struct _arch_register_class_t *cls, bitset_t *bs);
int be_put_ignore_regs(const be_irg_t *birg, const arch_register_class_t *cls,
bitset_t *bs);
#endif /* _BE_T_H */
#endif
......@@ -31,11 +31,11 @@
#include "be.h"
#include "beabi.h"
#include "bearch.h"
#include "bearch_t.h"
#include "benode_t.h"
#include "belive_t.h"
#include "besched_t.h"
#include "beirg.h"
#include "beirg_t.h"
#include "bessaconstr.h"
typedef struct _be_abi_call_arg_t {
......
/**
* Backend ABI implementation.
*/
#ifndef _BEABI_H
#define _BEABI_H
#ifndef FIRM_BEABI_H
#define FIRM_BEABI_H
#include "firm_types.h"
......@@ -13,6 +11,7 @@
#include "bitset.h"
#include "be.h"
#include "beirg.h"
#include "bearch.h"
#include "beabi_t.h"
......
......@@ -11,7 +11,7 @@
#include <string.h>
#include "bearch.h"
#include "bearch_t.h"
#include "ircons_t.h"
#include "irnode_t.h"
#include "xmalloc.h"
......
This diff is collapsed.
/**
* Type declarations for the BEARCH module.
* $Id$
*/
#ifndef _BEARCH_T_H_
#define _BEARCH_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;
#endif /* _BEARCH_T_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment