Commit 446c97de authored by Christoph Mallon's avatar Christoph Mallon
Browse files

cleanup: Move the implementation of bitset_fprint() into .c, to not spill...

cleanup: Move the implementation of bitset_fprint() into .c, to not spill #include "irprintf.h" everywhere.
parent bff1daca
/*
* 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);
}
...@@ -12,11 +12,9 @@ ...@@ -12,11 +12,9 @@
#ifndef FIRM_ADT_BITSET_H #ifndef FIRM_ADT_BITSET_H
#define FIRM_ADT_BITSET_H #define FIRM_ADT_BITSET_H
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <assert.h> #include <assert.h>
#include "irprintf.h"
#include "xmalloc.h" #include "xmalloc.h"
#include "bitfiddle.h" #include "bitfiddle.h"
#include "raw_bitset.h" #include "raw_bitset.h"
...@@ -340,18 +338,7 @@ static inline bool bitset_is_empty(const bitset_t *bs) ...@@ -340,18 +338,7 @@ static inline bool bitset_is_empty(const bitset_t *bs)
* @param file The stream. * @param file The stream.
* @param bs The bitset. * @param bs The bitset.
*/ */
static inline void bitset_fprint(FILE *file, const bitset_t *bs) void bitset_fprint(FILE *file, bitset_t const *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);
}
/** /**
* Perform tgt = tgt & src operation. * Perform tgt = tgt & src operation.
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#define FIRM_ANA_IRBACKEDGE_T_H #define FIRM_ANA_IRBACKEDGE_T_H
#include "bitset.h" #include "bitset.h"
#include "firm_types.h"
/** /**
* Allocate a new backedge array on the obstack for given size. * Allocate a new backedge array on the obstack for given size.
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "iredges.h" #include "iredges.h"
#include "tv.h" #include "tv.h"
#include "irop.h" #include "irop.h"
#include "irprintf.h"
#include "pdeq.h" #include "pdeq.h"
#include "irnodemap.h" #include "irnodemap.h"
#include "irhooks.h" #include "irhooks.h"
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "beifg.h" #include "beifg.h"
#include "besched.h" #include "besched.h"
#include "bemodule.h" #include "bemodule.h"
#include "irprintf.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg;) DEBUG_ONLY(static firm_dbg_module_t *dbg;)
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "beifg.h" #include "beifg.h"
#include "becopyopt_t.h" #include "becopyopt_t.h"
#include "belive.h" #include "belive.h"
#include "irprintf.h"
static void dump_ifg_nodes(FILE *F, const be_ifg_t *ifg) static void dump_ifg_nodes(FILE *F, const be_ifg_t *ifg)
{ {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "irnode_t.h" #include "irnode_t.h"
#include "entity_t.h" #include "entity_t.h"
#include "irloop_t.h" #include "irloop_t.h"
#include "irprintf.h"
#include "tv_t.h" #include "tv_t.h"
#include "dbginfo_t.h" #include "dbginfo_t.h"
#include "util.h" #include "util.h"
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "iredgekinds.h" #include "iredgekinds.h"
#include "iredges_t.h" #include "iredges_t.h"
#include "ircons.h" #include "ircons.h"
#include "irprintf.h"
#include "panic.h" #include "panic.h"
#include "irverify.h" #include "irverify.h"
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "set.h" #include "set.h"
#include "entity_t.h" #include "entity_t.h"
#include "irmode_t.h" #include "irmode_t.h"
#include "irprintf.h"
#include "irnode.h" #include "irnode.h"
#include "strcalc.h" #include "strcalc.h"
#include "fltcalc.h" #include "fltcalc.h"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "xmalloc.h" #include "xmalloc.h"
#include "util.h" #include "util.h"
#include "irmode_t.h" #include "irmode_t.h"
#include "irprintf.h"
#include "tv_t.h" #include "tv_t.h"
#include "ident_t.h" #include "ident_t.h"
#include "irprog_t.h" #include "irprog_t.h"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment