summaryrefslogtreecommitdiffhomepage
path: root/ir/adt
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-05-25 22:03:22 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-05-29 17:35:19 +0200
commit446c97de6f7c3bdeef819875fe8a4915ec8da777 (patch)
tree614b2bc761e6433a2053b0cb102390467c68acd5 /ir/adt
parentbff1dacaae1867e3752f2797a2560589d9eda918 (diff)
cleanup: Move the implementation of bitset_fprint() into .c, to not spill #include "irprintf.h" everywhere.
Diffstat (limited to 'ir/adt')
-rw-r--r--ir/adt/bitset.c18
-rw-r--r--ir/adt/bitset.h15
2 files changed, 19 insertions, 14 deletions
diff --git a/ir/adt/bitset.c b/ir/adt/bitset.c
new file mode 100644
index 0000000..9e37d65
--- /dev/null
+++ b/ir/adt/bitset.c
@@ -0,0 +1,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);
+}
diff --git a/ir/adt/bitset.h b/ir/adt/bitset.h
index ec0b193..9ef2cc8 100644
--- a/ir/adt/bitset.h
+++ b/ir/adt/bitset.h
@@ -12,11 +12,9 @@
#ifndef FIRM_ADT_BITSET_H
#define FIRM_ADT_BITSET_H
-#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
-#include "irprintf.h"
#include "xmalloc.h"
#include "bitfiddle.h"
#include "raw_bitset.h"
@@ -340,18 +338,7 @@ static inline bool bitset_is_empty(const bitset_t *bs)
* @param file The stream.
* @param bs The bitset.
*/
-static inline void bitset_fprint(FILE *file, const bitset_t *bs)
-{
- const char *prefix = "";
- size_t i;
-
- putc('{', file);
- for(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);
-}
+void bitset_fprint(FILE *file, bitset_t const *bs);
/**
* Perform tgt = tgt & src operation.