removed unused header
[libfirm] / ir / ana / irscc.c
index 75c74cb..83aad98 100644 (file)
@@ -1,18 +1,32 @@
 /*
- * Project:     libFIRM
- * File name:   ir/ana/irscc.c
- * Purpose:     Compute the strongly connected regions and build
+ * 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.
+ */
+
+/**
+ * @file
+ * @brief    Compute the strongly connected regions and build
  *              backedge/loop datastructures.
  *              A variation on the Tarjan algorithm. See also [Trapp:99],
  *              Chapter 5.2.1.2.
- * Author:      Goetz Lindenmaier
- * Modified by:
- * Created:     7.2002
- * CVS-ID:      $Id$
- * Copyright:   (c) 2002-2003 Universität Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ * @author   Goetz Lindenmaier
+ * @date     7.2002
+ * @version  $Id$
  */
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -436,8 +450,8 @@ add_loop_node(ir_loop *loop, ir_node *n) {
   loop->n_nodes++;
 }
 
-/** Returns the number of elements contained in loop.  */
-int get_loop_n_elements (ir_loop *loop) {
+/* Returns the number of elements contained in loop.  */
+int get_loop_n_elements (const ir_loop *loop) {
   assert(loop && loop->kind == k_ir_loop);
   return(ARR_LEN(loop->children));
 }
@@ -449,22 +463,22 @@ int get_loop_n_elements (ir_loop *loop) {
  and then select the appropriate "loop_element.node" or "loop_element.son".
 */
 
-loop_element get_loop_element (ir_loop *loop, int pos) {
+loop_element get_loop_element(const ir_loop *loop, int pos) {
   assert(loop && loop->kind == k_ir_loop && pos < ARR_LEN(loop->children));
-
   return(loop -> children[pos]);
 }
 
-int get_loop_element_pos(ir_loop *loop, void *le) {
-  int i;
+int get_loop_element_pos(const ir_loop *loop, void *le) {
+  int i, n;
   assert(loop && loop->kind == k_ir_loop);
 
-  for (i = 0; i < get_loop_n_elements(loop); i++)
+  n = get_loop_n_elements(loop);
+  for (i = 0; i < n; i++)
     if (get_loop_element(loop, i).node == le) return i;
   return -1;
 }
 
-int get_loop_loop_nr(ir_loop *loop) {
+int get_loop_loop_nr(const ir_loop *loop) {
   assert(loop && loop->kind == k_ir_loop);
 #ifdef DEBUG_libfirm
   return loop->loop_nr;