handle a/-1 and a%-1 right
[libfirm] / ir / ir / irphase_t.h
index f393b8e..f16135c 100644 (file)
@@ -1,34 +1,51 @@
 /*
- * Project:     libFIRM
- * File name:   ir/ir/irphase_t.c
- * Purpose:     Phase information handling using node indexes.
- * Author:      Sebastian Hack
- * Modified by:
- * Created:
- * CVS-ID:      $Id$
- * Copyright:   (c) 1998-2007 Universitaet Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ * 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.
  */
 
-#ifndef _FIRM_IR_PHASE_T_H
-#define _FIRM_IR_PHASE_T_H
+/**
+ * @file
+ * @brief   Phase information handling using node indexes.
+ * @author  Sebastian Hack
+ * @version $Id$
+ */
+#ifndef FIRM_IR_PHASE_T_H
+#define FIRM_IR_PHASE_T_H
 
 #include "firm_types.h"
-#include "obstack.h"
+#include "obst.h"
 #include "irgraph_t.h"
 #include "irtools.h"
-#include "irtools.h"
 
+/**
+ * For statistics: A type containing statistic data of a phase object.
+ */
 typedef struct {
-       unsigned node_slots;
-       unsigned node_slots_used;
-       unsigned node_data_bytes;
-       unsigned node_map_bytes;
-       unsigned overall_bytes;
+       unsigned node_slots;       /**< The number of allocated node slots. */
+       unsigned node_slots_used;  /**< The number of used node slots, ie. nodes that have node data. */
+       unsigned node_map_bytes;   /**< Number of used bytes for the node map. */
+       unsigned overall_bytes;    /**< Overall number of used bytes for the phase. */
 } phase_stat_t;
 
 /**
- * Phase statistics.
+ * Collect Phase statistics.
+ *
+ * @param phase  The phase.
+ * @param stat   Will be filled with the statistical data.
  */
 phase_stat_t *phase_stat(const ir_phase *phase, phase_stat_t *stat);
 
@@ -120,7 +137,7 @@ void phase_reinit_block_irn_data(ir_phase *phase, ir_node *block);
  *
  * @return The first irn having some data assigned, NULL otherwise
  */
-ir_node *phase_get_first_node(ir_phase *phase);
+ir_node *phase_get_first_node(const ir_phase *phase);
 
 /**
  * Returns the next node after @p start having some data assigned.
@@ -130,7 +147,7 @@ ir_node *phase_get_first_node(ir_phase *phase);
  *
  * @return The next node after start having some data assigned, NULL otherwise
  */
-ir_node *phase_get_next_node(ir_phase *phase, ir_node *start);
+ir_node *phase_get_next_node(const ir_phase *phase, ir_node *start);
 
 /**
  * Convenience macro to iterate over all nodes of a phase
@@ -292,4 +309,4 @@ static INLINE void *_phase_get_or_set_irn_data(ir_phase *ph, ir_node *irn)
        return res;
 }
 
-#endif /* _FIRM_IR_PHASE_T_H */
+#endif