5 struct _be_java_coal_t;
6 typedef struct _be_java_coal_t be_java_coal_t;
11 #include <libcore/lc_opts.h>
12 #include <libcore/lc_opts_enum.h>
13 #include "firm_config.h"
16 * Register libcore options.
18 void be_java_coal_register_options(lc_opt_entry_t *grp);
20 #endif /* WITH_LIBCORE */
23 * Add an interference edge
24 * @param n first node id.
25 * @param m second node id.
27 void be_java_coal_add_int_edge(be_java_coal_t *c, int n, int m);
30 * Add an affinity edge.
31 * @param n first node id.
32 * @param m second node id.
33 * @param costs Costs for the edge.
35 void be_java_coal_add_aff_edge(be_java_coal_t *c, int n, int m, int costs);
38 * Set the color of a node.
40 * @param col The color.
42 void be_java_coal_set_color(be_java_coal_t *c, int n, int col);
45 * Forbid a color for a node.
46 * Afterwards, the node may not be assigned that color.
48 * @param col The color.
50 void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col);
53 * Start the coalescing.
55 void be_java_coal_coalesce(be_java_coal_t *c);
58 * Dump the graph into a dot file.
59 * @param fn Filename to dump to.
61 void be_java_coal_dump(be_java_coal_t *c, const char *fn);
64 * Get the color of a node.
66 * @return The color of the node.
68 int be_java_coal_get_color(be_java_coal_t *c, int n);
71 * Init the JAVA coalescer.
72 * @param graph_name The name of the graph to coalesce.
73 * @param n_nodes The number of nodes in the graph. Each node has an ID which ranges from 0 to n_nodes - 1.
74 * @param n_regs The number of colors available.
75 * @param dbg_level Te debug level for the coalescer. 0 means quiet. >0 more verbose.
76 * @return The coalescing object.
78 be_java_coal_t *be_java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level);
81 * Destroy the coalescing object.
83 void be_java_coal_destroy(be_java_coal_t *c);