X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeirg.c;h=11d402c66944ae0917d1b451712eeed8917cf95d;hb=5427ad0b567409445284277a9c48d652179755ea;hp=42460def68177161a93478e14464a4483352ffc7;hpb=863d31d7a5c8210432fef88b30fc3e8353131538;p=libfirm diff --git a/ir/be/beirg.c b/ir/be/beirg.c index 42460def6..11d402c66 100644 --- a/ir/be/beirg.c +++ b/ir/be/beirg.c @@ -1,61 +1,80 @@ /* - * Author: Matthias Braun - * Date: 13.12.2006 - * Copyright: (c) Universitaet Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +/** + * @file + * @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(be_irg_t *birg) +be_lv_t *be_assure_liveness(ir_graph *irg) { - if(birg->lv != NULL) - return; + be_irg_t *birg = be_birg_from_irg(irg); + if (birg->lv != NULL) + return birg->lv; - birg->lv = be_liveness(birg->irg); + return birg->lv = be_liveness(birg->irg); } -void be_invalidate_liveness(be_irg_t *birg) +void be_assure_dom_front(ir_graph *irg) { - if(birg->lv == NULL) - return; - - be_liveness_free(birg->lv); - birg->lv = NULL; -} - -void be_assure_dom_front(be_irg_t *birg) -{ - if(birg->dom_front != NULL) + be_irg_t *birg = be_birg_from_irg(irg); + if (birg->dom_front != NULL) return; birg->dom_front = be_compute_dominance_frontiers(birg->irg); } -void be_invalidate_dom_front(be_irg_t *birg) +void be_invalidate_dom_front(ir_graph *irg) { - if(birg->dom_front == NULL) + be_irg_t *birg = be_birg_from_irg(irg); + if (birg->dom_front == NULL) return; be_free_dominance_frontiers(birg->dom_front); birg->dom_front = NULL; } -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; - if(birg->dom_front != NULL) { + if (birg->dom_front != NULL) { be_free_dominance_frontiers(birg->dom_front); birg->dom_front = NULL; } - if(birg->lv != NULL) { + if (birg->lv != NULL) { be_liveness_free(birg->lv); birg->lv = NULL; } + + obstack_free(&birg->obst, NULL); + irg->be_data = NULL; }