X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbejavacoal.h;h=cbf7aa6d24f75f8cb53e13a356ba911925a9f338;hb=662fc44c951bdb45a9b7d9563e9ffbb87101b9e4;hp=f6f9c7a07a61117ce19def189f8870c704b0549a;hpb=904ce4d595c733b7fdfe19a3245fa115f5c1d97f;p=libfirm diff --git a/ir/be/bejavacoal.h b/ir/be/bejavacoal.h index f6f9c7a07..cbf7aa6d2 100644 --- a/ir/be/bejavacoal.h +++ b/ir/be/bejavacoal.h @@ -1,30 +1,40 @@ - -#ifndef _BEJAVACOAL_H -#define _BEJAVACOAL_H - -struct _java_coal_t; -typedef struct _java_coal_t java_coal_t; - - -#ifdef WITH_LIBCORE - -#include -#include -#include "firm_config.h" +/* + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ /** - * Register libcore options. + * @file + * @brief Interface for external Java coalescer. + * @author Sebastian Hack + * @version $Id$ */ -void java_coal_register_options(lc_opt_entry_t *grp); +#ifndef FIRM_BE_BEJAVACOAL_H +#define FIRM_BE_BEJAVACOAL_H -#endif /* WITH_LIBCORE */ +struct _be_java_coal_t; +typedef struct _be_java_coal_t be_java_coal_t; /** * Add an interference edge * @param n first node id. * @param m second node id. */ -void java_coal_add_int_edge(java_coal_t *c, int n, int m); +void be_java_coal_add_int_edge(be_java_coal_t *c, int n, int m); /** * Add an affinity edge. @@ -32,14 +42,21 @@ void java_coal_add_int_edge(java_coal_t *c, int n, int m); * @param m second node id. * @param costs Costs for the edge. */ -void java_coal_add_aff_edge(java_coal_t *c, int n, int m, int costs); +void be_java_coal_add_aff_edge(be_java_coal_t *c, int n, int m, int costs); /** * Set the color of a node. * @param n The node. * @param col The color. */ -void java_coal_set_color(java_coal_t *c, int n, int col); +void be_java_coal_set_color(be_java_coal_t *c, int n, int col); + +/** + * Set debug information for a node. + * @param n The node. + * @param dbg Some string copied to Java. + */ +void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg); /** * Forbid a color for a node. @@ -47,25 +64,25 @@ void java_coal_set_color(java_coal_t *c, int n, int col); * @param n The node. * @param col The color. */ -void java_coal_forbid_color(java_coal_t *c, int n, int col); +void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col); /** * Start the coalescing. */ -void java_coal_coalesce(java_coal_t *c); +void be_java_coal_coalesce(be_java_coal_t *c); /** * Dump the graph into a dot file. * @param fn Filename to dump to. */ -void java_coal_dump(java_coal_t *c, const char *fn); +void be_java_coal_dump(be_java_coal_t *c, const char *fn); /** * Get the color of a node. * @param n The node. * @return The color of the node. */ -int java_coal_get_color(java_coal_t *c, int n); +int be_java_coal_get_color(be_java_coal_t *c, int n); /** * Init the JAVA coalescer. @@ -75,12 +92,19 @@ int java_coal_get_color(java_coal_t *c, int n); * @param dbg_level Te debug level for the coalescer. 0 means quiet. >0 more verbose. * @return The coalescing object. */ -java_coal_t *java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level); +be_java_coal_t *be_java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level); /** - * Destroy the coalescing object. + * Start the JVM. + * This is also done lazily by be_java_coal_init() but as that is called by + * the coalescing driver, it might tamper the runtime measurements. So here is + * an extra call. */ -void java_coal_destroy(java_coal_t *c); +void be_java_coal_start_jvm(void); +/** + * Destroy the coalescing object. + */ +void be_java_coal_destroy(be_java_coal_t *c); -#endif +#endif /* FIRM_BE_BEJAVACOAL_H */