X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeschedrand.c;h=b074c4c2e1dc44b1ace7f4cfd4348a3507cc3e38;hb=a8e4a954b36da58bce5413b569532ef54b87abcd;hp=900689e0f18fe5fafc8f594c1f21e85e560634a7;hpb=311439dee8e33414f35d7b262c5c49c52f4108d6;p=libfirm diff --git a/ir/be/beschedrand.c b/ir/be/beschedrand.c index 900689e0f..b074c4c2e 100644 --- a/ir/be/beschedrand.c +++ b/ir/be/beschedrand.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 Matthias Braun - * @date 29.08.2006 - * @cvs-id $Id$ + * @file + * @brief Random node selector. + * @author Matthias Braun + * @date 29.08.2006 + * @version $Id$ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -34,17 +54,17 @@ static ir_node *random_select(void *block_env, ir_nodeset_t *ready_set, } } - if(only_branches_left) { + if (only_branches_left) { /* at last: schedule branches */ ir_nodeset_iterator_init(&iter, ready_set); irn = ir_nodeset_iterator_next(&iter); } else { do { - // take 1 random node + /* take 1 random node */ int n = rand() % ir_nodeset_size(ready_set); int i = 0; ir_nodeset_iterator_init(&iter, ready_set); - while( (irn = ir_nodeset_iterator_next(&iter)) != NULL) { + while ((irn = ir_nodeset_iterator_next(&iter)) != NULL) { if(i == n) { break; }