X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fbe%2Fbeuses.h;h=290961b0e1a2dea34520dca4a8fed72d681880ae;hb=0e4318adc38a54110c1b1f7f1d5edc0ee2c78170;hp=637b419c4dd96b2582686382526c6a436af370c7;hpb=d1de7107f847963fbce099597e6c42c2371b053c;p=libfirm diff --git a/ir/be/beuses.h b/ir/be/beuses.h index 637b419c4..290961b0e 100644 --- a/ir/be/beuses.h +++ b/ir/be/beuses.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -30,32 +30,47 @@ #include "firm_types.h" #include "belive.h" -typedef struct _be_next_use_t { - unsigned time; - int outermost_loop; +/** + * Describes a use of a value. + */ +typedef struct be_next_use_t { + unsigned time; + 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; } -typedef struct _be_uses_t be_uses_t; +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