From 2922c6d1781518f7b564f28fad474d0e1c7aa7f2 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Mon, 5 Jul 2010 14:39:40 +0000 Subject: [PATCH] convert a few more place that mention birg into generic ir_graph* stuff [r27694] --- ir/be/beabi.c | 2 +- ir/be/becopyopt.c | 2 +- ir/be/becopypbqp.c | 2 +- ir/be/beirg.h | 27 ++++++++++++++++----------- ir/be/bepbqpcoloring.c | 2 +- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/ir/be/beabi.c b/ir/be/beabi.c index 3004b6d16..8508a7aec 100644 --- a/ir/be/beabi.c +++ b/ir/be/beabi.c @@ -2181,7 +2181,7 @@ static void fix_pic_symconsts(ir_node *node, void *data) ir_node *load_res; be_abi_irg_t *env = data; int arity, i; - be_main_env_t *be = be_birg_from_irg(env->irg)->main_env; + be_main_env_t *be = be_get_irg_main_env(env->irg); arity = get_irn_arity(node); for (i = 0; i < arity; ++i) { diff --git a/ir/be/becopyopt.c b/ir/be/becopyopt.c index c4b22b767..868dc9287 100644 --- a/ir/be/becopyopt.c +++ b/ir/be/becopyopt.c @@ -1130,7 +1130,7 @@ static FILE *my_open(const be_chordal_env_t *env, const char *prefix, const char char buf[1024]; size_t i, n; char *tu_name; - const char *cup_name = be_birg_from_irg(env->irg)->main_env->cup_name; + const char *cup_name = be_get_irg_main_env(env->irg)->cup_name; n = strlen(cup_name); tu_name = XMALLOCN(char, n + 1); diff --git a/ir/be/becopypbqp.c b/ir/be/becopypbqp.c index 870e57b85..ef2e733b9 100644 --- a/ir/be/becopypbqp.c +++ b/ir/be/becopypbqp.c @@ -43,7 +43,7 @@ static FILE *my_open(const be_chordal_env_t *env, const char *prefix, const char char buf[1024]; size_t i, n; char *tu_name; - const char *cup_name = be_birg_from_irg(irg)->main_env->cup_name; + const char *cup_name = be_get_irg_main_env(irg)->cup_name; n = strlen(cup_name); tu_name = XMALLOCN(char, n + 1); diff --git a/ir/be/beirg.h b/ir/be/beirg.h index 27f3ba1f3..3bf81520b 100644 --- a/ir/be/beirg.h +++ b/ir/be/beirg.h @@ -48,17 +48,17 @@ void be_free_birg(ir_graph *irg); * backend structures */ typedef struct be_irg_t { - ir_graph *irg; - be_main_env_t *main_env; - be_abi_irg_t *abi; - arch_code_generator_t *cg; - ir_exec_freq *exec_freq; - be_dom_front_info_t *dom_front; - be_lv_t *lv; - struct obstack obst; /**< birg obstack (mainly used to keep - register constraints which we can't keep - in the irg obst, because it gets replace - during code selection) */ + ir_graph *irg; + be_main_env_t *main_env; + be_abi_irg_t *abi; + arch_code_generator_t *cg; + ir_exec_freq *exec_freq; + be_dom_front_info_t *dom_front; + be_lv_t *lv; + struct obstack obst; /**< birg obstack (mainly used to keep + register constraints which we can't keep + in the irg obst, because it gets replace + during code selection) */ } be_irg_t; static inline be_irg_t *be_birg_from_irg(const ir_graph *irg) @@ -66,6 +66,11 @@ static inline be_irg_t *be_birg_from_irg(const ir_graph *irg) return (be_irg_t*) irg->be_data; } +static inline be_main_env_t *be_get_irg_main_env(const ir_graph *irg) +{ + return be_birg_from_irg(irg)->main_env; +} + static inline be_lv_t *be_get_irg_liveness(const ir_graph *irg) { return be_birg_from_irg(irg)->lv; diff --git a/ir/be/bepbqpcoloring.c b/ir/be/bepbqpcoloring.c index 99290d0bc..b04ddeaf1 100644 --- a/ir/be/bepbqpcoloring.c +++ b/ir/be/bepbqpcoloring.c @@ -114,7 +114,7 @@ static FILE *my_open(const be_chordal_env_t *env, const char *prefix, const char char buf[1024]; size_t i, n; char *tu_name; - const char *cup_name = be_birg_from_irg(env->irg)->main_env->cup_name; + const char *cup_name = be_get_irg_main_env(env->irg)->cup_name; n = strlen(cup_name); tu_name = XMALLOCN(char, n + 1); -- 2.20.1