X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeirg.h;h=2f16db5b96c2f9b24483e181927bb7a1add819b0;hb=1bc218edf7404a09c1e095b63dcc56facc107294;hp=757b0f29dca4914c8e74a797db6ec3f06fb8787d;hpb=863d31d7a5c8210432fef88b30fc3e8353131538;p=libfirm diff --git a/ir/be/beirg.h b/ir/be/beirg.h index 757b0f29d..2f16db5b9 100644 --- a/ir/be/beirg.h +++ b/ir/be/beirg.h @@ -1,30 +1,41 @@ -/** - * Author: Matthias Braun - * Date: 05.05.2006 - * Copyright: (c) Universitaet Karlsruhe - * License: This file is 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. * - * Backend irg - a ir_graph with additional analysis information + * 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. */ -#ifndef BEIRG_H_ -#define BEIRG_H_ - -#include "belive.h" -#include "bedomfront.h" -typedef struct _be_irg_t be_irg_t; +/** + * @file + * @brief Backend irg - a ir_graph with additional analysis information. + * @author Matthias Braun + * @date 05.05.2006 + * @version $Id$ + */ +#ifndef FIRM_BE_BEIRG_H +#define FIRM_BE_BEIRG_H -ir_graph *be_get_birg_irg(const be_irg_t *birg); +#include "be.h" +#include "be_types.h" +#include "be_t.h" +#include "irtypes.h" -void be_assure_liveness(be_irg_t *birg); -void be_invalidate_liveness(be_irg_t *birg); -be_lv_t *be_get_birg_liveness(const be_irg_t *birg); +be_lv_t *be_assure_liveness(be_irg_t *birg); void be_assure_dom_front(be_irg_t *birg); void be_invalidate_dom_front(be_irg_t *birg); -be_dom_front_info_t *be_get_birg_dom_front(const be_irg_t *birg); - -ir_exec_freq *be_get_birg_exec_freq(const be_irg_t *birg); /** * frees all memory allocated by birg structures (liveness, dom_front, ...). @@ -32,4 +43,58 @@ ir_exec_freq *be_get_birg_exec_freq(const be_irg_t *birg); */ void be_free_birg(be_irg_t *birg); -#endif +/** + * An ir_graph with additional analysis data about this irg. Also includes some + * backend structures + */ +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) */ +}; + +static inline be_lv_t *be_get_birg_liveness(const be_irg_t *birg) +{ + return birg->lv; +} + +static inline ir_exec_freq *be_get_birg_exec_freq(const be_irg_t *birg) +{ + return birg->exec_freq; +} + +static inline be_dom_front_info_t *be_get_birg_dom_front(const be_irg_t *birg) +{ + return birg->dom_front; +} + +static inline ir_graph *be_get_birg_irg(const be_irg_t *birg) +{ + return birg->irg; +} + +static inline const arch_env_t *be_get_birg_arch_env(const be_irg_t *birg) +{ + return birg->main_env->arch_env; +} + +static inline be_irg_t *be_birg_from_irg(const ir_graph *irg) +{ + return (be_irg_t*) irg->be_data; +} + +static inline struct obstack *be_get_birg_obst(const ir_graph *irg) +{ + be_irg_t *birg = be_birg_from_irg(irg); + return &birg->obst; +} + +#endif /* FIRM_BE_BEIRG_H */