X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeschedtrivial.c;h=dab5a426782473da3ef1c778a3d2eb258ec7df0b;hb=0f3f5dcf8b021c4c43eb8b47f59c6aad0972ce0e;hp=80f1156e1beec1a4f1d087996c5a34406d6e1b11;hpb=0c92b911be3d9d02b4a49b2a142dab8d7ba978a6;p=libfirm diff --git a/ir/be/beschedtrivial.c b/ir/be/beschedtrivial.c index 80f1156e1..dab5a4267 100644 --- a/ir/be/beschedtrivial.c +++ b/ir/be/beschedtrivial.c @@ -1,8 +1,28 @@ +/* + * Copyright (C) 1995-2007 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" @@ -10,7 +30,11 @@ #include -#include "besched_t.h" +#include "irgraph.h" +#include "irnode.h" +#include "irnodeset.h" + +#include "bearch.h" #include "belistsched.h" /** @@ -18,33 +42,39 @@ * Just assure that branches are executed last, otherwise select * the first node ready. */ -static ir_node *trivial_select(void *block_env, nodeset *ready_set, nodeset *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; + (void) live_set; /* assure that branches and constants are executed last */ - for (irn = nodeset_first(ready_set); irn; irn = nodeset_next(ready_set)) { + foreach_ir_nodeset(ready_set, irn, iter) { if (! arch_irn_class_is(arch_env, irn, branch)) { - nodeset_break(ready_set); return irn; } } /* at last: schedule branches */ - irn = nodeset_first(ready_set); - nodeset_break(ready_set); + ir_nodeset_iterator_init(&iter, ready_set); + irn = ir_nodeset_iterator_next(&iter); 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 arch_env_t *arch_env, ir_graph *irg) { + (void) vtab; + (void) irg; return (void *)arch_env; } -static void *trivial_init_block(void *graph_env, ir_node *bl) +static void *trivial_init_block(void *graph_env, ir_node *block) { + (void) block; return graph_env; }