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 * Set debug information for a node.
47 * @param dbg Some string copied to Java.
49 void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg);
52 * Forbid a color for a node.
53 * Afterwards, the node may not be assigned that color.
55 * @param col The color.
57 void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col);
60 * Start the coalescing.
62 void be_java_coal_coalesce(be_java_coal_t *c);
65 * Dump the graph into a dot file.
66 * @param fn Filename to dump to.
68 void be_java_coal_dump(be_java_coal_t *c, const char *fn);
71 * Get the color of a node.
73 * @return The color of the node.
75 int be_java_coal_get_color(be_java_coal_t *c, int n);
78 * Init the JAVA coalescer.
79 * @param graph_name The name of the graph to coalesce.
80 * @param n_nodes The number of nodes in the graph. Each node has an ID which ranges from 0 to n_nodes - 1.
81 * @param n_regs The number of colors available.
82 * @param dbg_level Te debug level for the coalescer. 0 means quiet. >0 more verbose.
83 * @return The coalescing object.
85 be_java_coal_t *be_java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level);
89 * This is also done lazily by be_java_coal_init() but as that is called by
90 * the coalescing driver, it might tamper the runtime measurements. So here is
93 void be_java_coal_start_jvm(void);
96 * Destroy the coalescing object.
98 void be_java_coal_destroy(be_java_coal_t *c);