aboutsummaryrefslogtreecommitdiff
path: root/src/unreachable.c
blob: aa04f4611d927666684c0f161e00b9742df4f995 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <qbt/unreachable.h>

void remove_unvisited(struct fn *f, int visited)
{
	struct vec new = vec_create(sizeof(struct blk *));
	foreach_blk(bi, f->blks) {
		struct blk *b = blk_at(f->blks, bi);
		if (b->visited < visited)
			destroy_block(b);
		else
			vec_append(&new, &b);
	}

	vec_destroy(&f->blks);
	f->blks = new;
}