+#ifdef DEBUG_libfirm
+
+/**
+ * Write a chunk to stderr for debugging.
+ */
+static void dbg_aff_chunk(co_mst_env_t *env, aff_chunk_t *c) {
+ int idx;
+ if (c->weight_consistent)
+ ir_fprintf(stderr, " $%d ", c->weight);
+ ir_fprintf(stderr, "{");
+ bitset_foreach(c->nodes, idx) {
+ ir_node *n = get_idx_irn(env->co->irg, idx);
+ ir_fprintf(stderr, " %+F,", n);
+ }
+ ir_fprintf(stderr, "}");
+}
+
+/**
+ * Dump all admissible colors to stderr.
+ */
+static void dbg_admissible_colors(co_mst_env_t *env, co_mst_irn_t *node) {
+ int idx;
+ if (bitset_popcnt(node->adm_colors) < 1)
+ fprintf(stderr, "no admissible colors?!?");
+ else {
+ bitset_foreach(node->adm_colors, idx)
+ fprintf(stderr, " %d", idx);
+ }
+}
+
+/**
+ * Dump color-cost pairs to stderr.
+ */
+static void dbg_col_cost(co_mst_env_t *env, col_cost_t *cost) {
+ int i;
+ for (i = 0; i < env->n_regs; ++i) {
+ if (cost[i].cost == COL_COST_INFEASIBLE)
+ fprintf(stderr, " (%d, INF)", cost[i].col);
+ else
+ fprintf(stderr, " (%d, %.1f)", cost[i].col, cost[i].cost);
+ }
+}
+
+#endif /* DEBUG_libfirm */
+