X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeuses.h;h=dbd74eb506ad57499d8f441e6cf374e0db499626;hb=5474a1c188c9d59eea2c915515980cd9cbab58d8;hp=836f4ee900bc7dc24bfba3f60aef938885fb5925;hpb=ab182d4b9ed44239ab3ff1d08b2f8e14a3699ccf;p=libfirm diff --git a/ir/be/beuses.h b/ir/be/beuses.h index 836f4ee90..dbd74eb50 100644 --- a/ir/be/beuses.h +++ b/ir/be/beuses.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -22,7 +22,6 @@ * @brief Methods to compute when a value will be used again. * @author Sebastian Hack, Matthias Braun * @date 27.06.2005 - * @version $Id$ */ #ifndef FIRM_BE_BEUSES_H #define FIRM_BE_BEUSES_H @@ -30,21 +29,25 @@ #include "firm_types.h" #include "belive.h" +/** + * Describes a use of a value. + */ typedef struct be_next_use_t { unsigned time; - int outermost_loop; + unsigned outermost_loop; + /* point of the next use is at the beginning of this node. */ const ir_node *before; } be_next_use_t; #define USES_INFINITY 10000000 #define USES_PENDING 9999999 -static inline int USES_IS_INFINITE(unsigned time) +static inline bool USES_IS_INFINITE(unsigned time) { return time >= USES_INFINITY; } -static inline int USES_IS_PENDING(unsigned time) +static inline bool USES_IS_PENDING(unsigned time) { return time == USES_PENDING; } @@ -52,11 +55,21 @@ static inline int USES_IS_PENDING(unsigned time) typedef struct be_uses_t be_uses_t; be_next_use_t be_get_next_use(be_uses_t *uses, ir_node *from, - unsigned from_step, const ir_node *def, - int skip_from_uses); + const ir_node *def, int skip_from_uses); +/** + * Creates a new uses environment for a graph. + * + * @param irg the graph + * @param lv liveness information for the graph + */ be_uses_t *be_begin_uses(ir_graph *irg, const be_lv_t *lv); +/** + * Destroys the given uses environment. + * + * @param uses the environment + */ void be_end_uses(be_uses_t *uses); -#endif /* FIRM_BE_BEUSES_H */ +#endif