summaryrefslogtreecommitdiffhomepage
path: root/ir/adt/bitset.c
blob: 5ccc1ef34b67adc49b9556527dca9ecdd2511554 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * This file is part of libFirm.
 * Copyright (C) 2015 University of Karlsruhe.
 */
#include "bitset.h"

#include "irprintf.h"

void bitset_fprint(FILE *const file, bitset_t const *const bs)
{
	putc('{', file);
	char const *prefix = "";
	for (size_t i = bitset_next_set(bs, 0); i != (size_t)-1; i = bitset_next_set(bs, i + 1)) {
		ir_fprintf(file, "%s%zu", prefix, i);
		prefix = ",";
	}
	putc('}', file);
}