X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Firlivechk.h;h=ded033b0cf996559a02cd895181bb59d3489f906;hb=2bf74f898dd67f0004d7d5d1e9c41f4aa3a28bde;hp=44ecd183f49c53fe5294aa54ac772ec21d129065;hpb=6c694085a1d9ea8d0be49170e2f1ce64682f4d54;p=libfirm diff --git a/ir/ana/irlivechk.h b/ir/ana/irlivechk.h index 44ecd183f..ded033b0c 100644 --- a/ir/ana/irlivechk.h +++ b/ir/ana/irlivechk.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2007 Inria Rhone-Alpes. All right reserved. * * This file is part of libFirm. * @@ -21,23 +21,27 @@ * @file irlivechk.h * @author Sebastian Hack * @date 22.04.2007 - * @version $Id: $ - * @summary + * @brief * * Live in/end checks whose only precomputation concerns the structure of the CFG. * Hence, nothing has to be updated if the program is modified unless the CFG is touched. * See .c file for more comments. - * - * Copyright (C) 2007 Universitaet Karlsruhe - * Released under the GPL */ + #ifndef FIRM_ANA_IRLIVECHK_H #define FIRM_ANA_IRLIVECHK_H #include "irgraph.h" #include "irnode.h" -typedef struct _lv_chk_t lv_chk_t; +typedef enum { + lv_chk_state_in = 1, + lv_chk_state_end = 2, + lv_chk_state_out = 4, + lv_chk_state_through = lv_chk_state_in | lv_chk_state_out | lv_chk_state_end, +} lv_chk_state_t; + +typedef struct lv_chk_t lv_chk_t; /** * Make a new liveness check environment. @@ -52,31 +56,18 @@ extern lv_chk_t *lv_chk_new(ir_graph *irg); */ extern void lv_chk_free(lv_chk_t *lv); -/** - * Check, if a node is live end of a given block. - * @param lv The liveness environment. - * @param bl The block to investigate. - * @param irn The node to check for. - * @return 1, if @p what is live end at @p bl, 0 else. - */ -extern int lv_chk_bl_end(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn); /** - * Check, if a node is live out of a given block. + * Return liveness information for a node concerning a block. * @param lv The liveness environment. * @param bl The block to investigate. * @param irn The node to check for. - * @return 1, if @p what is live out at @p bl, 0 else. + * @return A bitmask of lv_chk_state_t. */ -extern int lv_chk_bl_out(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn); +extern unsigned lv_chk_bl_xxx(lv_chk_t *lv, const ir_node *bl, const ir_node *irn); -/** - * Check, if a node is live in of a given block. - * @param lv The liveness environment. - * @param bl The block to investigate. - * @param irn The node to check for. - * @return 1, if @p what is live in at @p bl, 0 else. - */ -extern int lv_chk_bl_in(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn); +#define lv_chk_bl_in(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_in) != 0) +#define lv_chk_bl_end(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_end) != 0) +#define lv_chk_bl_out(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_out) != 0) #endif /* FIRM_ANA_IRLIVECHK_H */