5 struct _be_java_coal_t;
6 typedef struct _be_java_coal_t be_java_coal_t;
9 * Add an interference edge
10 * @param n first node id.
11 * @param m second node id.
13 void be_java_coal_add_int_edge(be_java_coal_t *c, int n, int m);
16 * Add an affinity edge.
17 * @param n first node id.
18 * @param m second node id.
19 * @param costs Costs for the edge.
21 void be_java_coal_add_aff_edge(be_java_coal_t *c, int n, int m, int costs);
24 * Set the color of a node.
26 * @param col The color.
28 void be_java_coal_set_color(be_java_coal_t *c, int n, int col);
31 * Set debug information for a node.
33 * @param dbg Some string copied to Java.
35 void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg);
38 * Forbid a color for a node.
39 * Afterwards, the node may not be assigned that color.
41 * @param col The color.
43 void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col);
46 * Start the coalescing.
48 void be_java_coal_coalesce(be_java_coal_t *c);
51 * Dump the graph into a dot file.
52 * @param fn Filename to dump to.
54 void be_java_coal_dump(be_java_coal_t *c, const char *fn);
57 * Get the color of a node.
59 * @return The color of the node.
61 int be_java_coal_get_color(be_java_coal_t *c, int n);
64 * Init the JAVA coalescer.
65 * @param graph_name The name of the graph to coalesce.
66 * @param n_nodes The number of nodes in the graph. Each node has an ID which ranges from 0 to n_nodes - 1.
67 * @param n_regs The number of colors available.
68 * @param dbg_level Te debug level for the coalescer. 0 means quiet. >0 more verbose.
69 * @return The coalescing object.
71 be_java_coal_t *be_java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level);
75 * This is also done lazily by be_java_coal_init() but as that is called by
76 * the coalescing driver, it might tamper the runtime measurements. So here is
79 void be_java_coal_start_jvm(void);
82 * Destroy the coalescing object.
84 void be_java_coal_destroy(be_java_coal_t *c);