X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeirg.c;h=36504b558df677c73056e623ff353c6c3af371cb;hb=5474a1c188c9d59eea2c915515980cd9cbab58d8;hp=95791779c3b4b26cafc02aa6e393a45ee1113f01;hpb=8eee0e6361868153ae82c8d8bdda1446a9af9084;p=libfirm diff --git a/ir/be/beirg.c b/ir/be/beirg.c index 95791779c..36504b558 100644 --- a/ir/be/beirg.c +++ b/ir/be/beirg.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -22,59 +22,61 @@ * @brief Backend irg - a ir_graph with additional analysis information. * @author Matthias Braun * @date 13.12.2006 - * @version $Id$ */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "execfreq.h" -#include "beirg_t.h" +#include "beirg.h" +#include "absgraph.h" +#include "belive.h" +#include "bedomfront.h" -void be_assure_liveness_chk(be_irg_t *birg) +void be_assure_dom_front(ir_graph *irg) { - if (birg->lv_chk != NULL) + be_irg_t *birg = be_birg_from_irg(irg); + if (birg->dom_front != NULL) return; - birg->lv_chk = lv_chk_new(birg->irg); + birg->dom_front = be_compute_dominance_frontiers(birg->irg); } -void be_assure_liveness(be_irg_t *birg) +void be_invalidate_dom_front(ir_graph *irg) { - if (birg->lv != NULL) + be_irg_t *birg = be_birg_from_irg(irg); + if (birg->dom_front == NULL) return; - birg->lv = be_liveness(birg->irg); + be_free_dominance_frontiers(birg->dom_front); + birg->dom_front = NULL; } -void be_invalidate_liveness(be_irg_t *birg) +void be_invalidate_live_sets(ir_graph *irg) { - if (birg->lv == NULL) - return; - - be_liveness_free(birg->lv); - birg->lv = NULL; + be_irg_t *birg = be_birg_from_irg(irg); + be_liveness_invalidate_sets(birg->lv); } -void be_assure_dom_front(be_irg_t *birg) +void be_invalidate_live_chk(ir_graph *irg) { - if (birg->dom_front != NULL) - return; - - birg->dom_front = be_compute_dominance_frontiers(birg->irg); + be_irg_t *birg = be_birg_from_irg(irg); + be_liveness_invalidate_chk(birg->lv); } -void be_invalidate_dom_front(be_irg_t *birg) +void be_assure_live_sets(ir_graph *irg) { - if (birg->dom_front == NULL) - return; + be_irg_t *birg = be_birg_from_irg(irg); + be_liveness_compute_sets(birg->lv); +} - be_free_dominance_frontiers(birg->dom_front); - birg->dom_front = NULL; +void be_assure_live_chk(ir_graph *irg) +{ + be_irg_t *birg = be_birg_from_irg(irg); + be_liveness_compute_chk(birg->lv); } -void be_free_birg(be_irg_t *birg) +void be_free_birg(ir_graph *irg) { + be_irg_t *birg = be_birg_from_irg(irg); free_execfreq(birg->exec_freq); birg->exec_freq = NULL; @@ -86,34 +88,7 @@ void be_free_birg(be_irg_t *birg) be_liveness_free(birg->lv); birg->lv = NULL; } -} -ir_graph *(be_get_birg_irg)(const be_irg_t *birg) -{ - return _be_get_birg_irg(birg); -} - -ir_exec_freq *(be_get_birg_exec_freq)(const be_irg_t *birg) -{ - return _be_get_birg_exec_freq(birg); -} - -be_lv_t *(be_get_birg_liveness)(const be_irg_t *birg) -{ - return _be_get_birg_liveness(birg); -} - -lv_chk_t *(be_get_birg_liveness_chk)(const be_irg_t *birg) -{ - return _be_get_birg_liveness_chk(birg); -} - -be_dom_front_info_t *(be_get_birg_dom_front)(const be_irg_t *birg) -{ - return _be_get_birg_dom_front(birg); -} - -const arch_env_t *(be_get_birg_arch_env)(const be_irg_t *birg) -{ - return _be_get_birg_arch_env(birg); + obstack_free(&birg->obst, NULL); + irg->be_data = NULL; }