2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 struct _be_java_coal_t;
25 typedef struct _be_java_coal_t be_java_coal_t;
28 * Add an interference edge
29 * @param n first node id.
30 * @param m second node id.
32 void be_java_coal_add_int_edge(be_java_coal_t *c, int n, int m);
35 * Add an affinity edge.
36 * @param n first node id.
37 * @param m second node id.
38 * @param costs Costs for the edge.
40 void be_java_coal_add_aff_edge(be_java_coal_t *c, int n, int m, int costs);
43 * Set the color of a node.
45 * @param col The color.
47 void be_java_coal_set_color(be_java_coal_t *c, int n, int col);
50 * Set debug information for a node.
52 * @param dbg Some string copied to Java.
54 void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg);
57 * Forbid a color for a node.
58 * Afterwards, the node may not be assigned that color.
60 * @param col The color.
62 void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col);
65 * Start the coalescing.
67 void be_java_coal_coalesce(be_java_coal_t *c);
70 * Dump the graph into a dot file.
71 * @param fn Filename to dump to.
73 void be_java_coal_dump(be_java_coal_t *c, const char *fn);
76 * Get the color of a node.
78 * @return The color of the node.
80 int be_java_coal_get_color(be_java_coal_t *c, int n);
83 * Init the JAVA coalescer.
84 * @param graph_name The name of the graph to coalesce.
85 * @param n_nodes The number of nodes in the graph. Each node has an ID which ranges from 0 to n_nodes - 1.
86 * @param n_regs The number of colors available.
87 * @param dbg_level Te debug level for the coalescer. 0 means quiet. >0 more verbose.
88 * @return The coalescing object.
90 be_java_coal_t *be_java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level);
94 * This is also done lazily by be_java_coal_init() but as that is called by
95 * the coalescing driver, it might tamper the runtime measurements. So here is
98 void be_java_coal_start_jvm(void);
101 * Destroy the coalescing object.
103 void be_java_coal_destroy(be_java_coal_t *c);