Add is_Conv().
[libfirm] / ir / ir / irgraph.h
index 3b2f52a..a2d769b 100644 (file)
@@ -1,24 +1,30 @@
 /*
- * Project:     libFIRM
- * File name:   ir/ir/irgraph.c
- * Purpose:     Entry point to the representation of procedure code.
- * Author:      Martin Trapp, Christian Schaefer
- * Modified by: Goetz Lindenmaier
- * Created:
- * CVS-ID:      $Id$
- * Copyright:   (c) 1998-2003 Universität 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.
  */
 
 /**
- * @file irgraph.h
- *
- * ir graph construction.
- *
- * @author Martin Trapp, Christian Schaefer
+ * @file
+ * @brief    Entry point to the representation of procedure code.
+ * @author   Martin Trapp, Christian Schaefer, Goetz Lindenmaier
+ * @version  $Id$
  */
-#ifndef _FIRM_IR_IRGRAPH_H_
-#define _FIRM_IR_IRGRAPH_H_
+#ifndef FIRM_IR_IRGRAPH_H
+#define FIRM_IR_IRGRAPH_H
 
 #include <stddef.h>
 
  * - Phi_in_stack;   a stack needed for automatic Phi construction, needed only
  *                   during ir construction.
  *
- * - isited         A int used as flag to traverse the ir_graph.
+ * - visited         A int used as flag to traverse the ir_graph.
  *
  * - block_visited    A int used as a flag to traverse block nodes in the graph.
  */
@@ -478,13 +484,32 @@ void          inc_irg_block_visited (ir_graph *irg);
 unsigned long get_irg_block_visited (const ir_graph *irg);
 void          set_irg_block_visited (ir_graph *irg, unsigned long i);
 
-/** Flags indicating whether or not we are inside an irg/block walk. */
-void     set_inside_block_walk(ir_graph *irg);
-void     clear_inside_block_walk(ir_graph *irg);
-unsigned inside_block_walk(const ir_graph *irg);
-void     set_inside_irg_walk(ir_graph *irg);
-void     clear_inside_irg_walk(ir_graph *irg);
-unsigned inside_irg_walk(const ir_graph *irg);
+/**
+ * Debug helpers: You can indicate wether you are currently using visited or
+ * block_visited flags. If NDEBUG is not defined, then the compiler will abort
+ * if 2 parties try to use the flags.
+ */
+#ifndef NDEBUG
+void     set_using_block_visited(ir_graph *irg);
+void     clear_using_block_visited(ir_graph *irg);
+int      using_block_visited(const ir_graph *irg);
+void     set_using_visited(ir_graph *irg);
+void     clear_using_visited(ir_graph *irg);
+int      using_visited(const ir_graph *irg);
+void     set_using_irn_link(ir_graph *irg);
+void     clear_using_irn_link(ir_graph *irg);
+int      using_irn_link(const ir_graph *irg);
+#else
+static INLINE void set_using_block_visited(ir_graph *irg) { (void) irg; }
+static INLINE void clear_using_block_visited(ir_graph *irg) { (void) irg; }
+static INLINE int using_block_visited(const ir_graph *irg) { (void) irg; return 0; }
+static INLINE void set_using_visited(ir_graph *irg) { (void) irg; }
+static INLINE void clear_using_visited(ir_graph *irg) { (void) irg; }
+static INLINE int using_visited(const ir_graph *irg) { (void) irg; return 0; }
+static INLINE void set_using_irn_link(ir_graph *irg) { (void) irg; }
+static INLINE void clear_using_irn_link(ir_graph *irg) { (void) irg; }
+static INLINE int using_irn_link(const ir_graph *irg) { (void) irg; return 0; }
+#endif
 
 /** move Proj nodes into the same block as its predecessors */
 void normalize_proj_nodes(ir_graph *irg);
@@ -539,4 +564,4 @@ void set_irg_fp_model(ir_graph *irg, unsigned model);
  */
 size_t register_additional_graph_data(size_t size);
 
-#endif /* _FIRM_IR_IRGRAPH_H_ */
+#endif