#include "irnode_t.h"
#include "irgraph_t.h"
#include "irgwalk.h"
+#include "irbitset.h"
#include "be_t.h"
#include "bera.h"
element = get_next_element(irn, it);
}
- if (element != NULL && element->irn == irn) /* the node you are searching neighbors for */
+ if (element && element->irn == irn) /* the node you are searching neighbors for */
{
it->curr_cli_element = element;
element = get_next_element(irn, it);
static ir_node *get_next_neighbour(cli_iter_t *it)
{
ir_node *res = NULL;
- cli_element_t *element;
cli_head_t *cli_head = it->curr_cli_head;
const ir_node *irn = it->curr_irn;
else
return NULL;
- element = get_next_element(irn, it);
-
- if (element == NULL) /* no more elements in this clique */
- {
- it->curr_cli_element = NULL;
- }
- else
- {
- it->curr_cli_element = element;
- }
+ it->curr_cli_element = get_next_element(irn, it);
- if (!(res == NULL))
+ if (res)
{
- if (bitset_is_set(it->ifg->visited_neighbours, get_irn_idx(res)))
+ if (bitset_contains_irn(it->ifg->visited_neighbours, res))
{
res = get_next_neighbour(it);
-// if (res == NULL) /* there are no more neighbours to return */
-// {
-// return NULL;
-// }
}
else
{
static int ifg_clique_degree(const void *self, const ir_node *irn)
{
int degree = -1;
- cli_iter_t *it = NULL;
+ cli_iter_t it;
- find_first_neighbour(self, it, irn);
+ find_first_neighbour(self, &it, irn);
degree = 0;
- irn = get_next_neighbour(it);
+ irn = get_next_neighbour(&it);
while (irn != NULL)
{
degree++;
- irn = get_next_neighbour(it);
+ irn = get_next_neighbour(&it);
}
return degree;