X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeschedtrivial.c;h=b95fefedb82df60093276ca90d5cd96c2c6a035d;hb=5bb8cd35a8074112fa2da8b8f68d7c77918119e5;hp=9b9586523587f4f7affeac78d7a8410575128a4e;hpb=863d31d7a5c8210432fef88b30fc3e8353131538;p=libfirm diff --git a/ir/be/beschedtrivial.c b/ir/be/beschedtrivial.c index 9b9586523..b95fefedb 100644 --- a/ir/be/beschedtrivial.c +++ b/ir/be/beschedtrivial.c @@ -1,16 +1,38 @@ +/* + * 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. + */ + /** - * Trivial node selector. - * @author Christian Wuerdig - * @date 29.08.2006 - * @cvs-id $Id$ + * @file + * @brief Trivial node selector. + * @author Sebastian Hack + * @date 29.08.2006 + * @version $Id$ */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include -#include "besched_t.h" +#include "irgraph.h" +#include "irnode.h" +#include "irnodeset.h" + +#include "bearch.h" #include "belistsched.h" /** @@ -18,15 +40,17 @@ * Just assure that branches are executed last, otherwise select * the first node ready. */ -static ir_node *trivial_select(void *block_env, ir_nodeset_t *ready_set, ir_nodeset_t *live_set) +static ir_node *trivial_select(void *block_env, ir_nodeset_t *ready_set, + ir_nodeset_t *live_set) { - const arch_env_t *arch_env = block_env; - ir_node *irn = NULL; - ir_nodeset_iterator_t iter; + ir_node *irn; + ir_nodeset_iterator_t iter; + (void)block_env; + (void)live_set; /* assure that branches and constants are executed last */ foreach_ir_nodeset(ready_set, irn, iter) { - if (! arch_irn_class_is(arch_env, irn, branch)) { + if (!is_cfop(irn)) { return irn; } } @@ -38,17 +62,21 @@ static ir_node *trivial_select(void *block_env, ir_nodeset_t *ready_set, ir_node return irn; } -static void *trivial_init_graph(const list_sched_selector_t *vtab, const arch_env_t *arch_env, ir_graph *irg) +static void *trivial_init_graph(const list_sched_selector_t *vtab, const be_irg_t *birg) { - return (void *)arch_env; + (void)vtab; + (void)birg; + return NULL; } -static void *trivial_init_block(void *graph_env, ir_node *bl) +static void *trivial_init_block(void *graph_env, ir_node *block) { - return graph_env; + (void)graph_env; + (void)block; + return NULL; } -static const list_sched_selector_t trivial_selector_struct = { +const list_sched_selector_t trivial_selector = { trivial_init_graph, trivial_init_block, trivial_select, @@ -60,5 +88,3 @@ static const list_sched_selector_t trivial_selector_struct = { NULL, /* finish_block */ NULL /* finish_graph */ }; - -const list_sched_selector_t *trivial_selector = &trivial_selector_struct;