Add is_Conv().
[libfirm] / ir / ir / irdump.h
index e1c1117..c2ada43 100644 (file)
@@ -1,41 +1,49 @@
 /*
- * Project:     libFIRM
- * File name:   ir/ir/irdump.h
- * Purpose:     Write vcg representation of firm to file.
- * Author:      Martin Trapp, Christian Schaefer
- * Modified by: Goetz Lindenmaier, Hubert Schmidt
- * 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 irdump.h
- *
- * Dump routines for the ir graph and all type information.
+ * @file
+ * @brief   Write vcg representation of firm to file.
+ * @author  Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Hubert Schmidt
+ * @version $Id$
+ * @summary
+ *  Dump routines for the ir graph and all type information.
  *
- * @author Martin Trapp, Christian Schaefer
+ *  The dump format of most functions is vcg.  This is a text based graph
+ *  representation. Some use the original format,
+ *  but most generate an extended format that is only read by some special
+ *  versions of xvcg or by the comercialized version now calles aiSee.
+ *  A test version of aiSee is available at
+ *   http://www.absint.de/aisee/download/index.htm.
  *
- * The dump format of most functions is vcg.  This is a text based graph
- * representation. Some use the original format,
- * but most generate an extended format that is only read by some special
- * versions of xvcg or by the comercialized version now calles aiSee.
- * A test version of aiSee is available at
- * http://www.absint.de/aisee/download/index.htm.
+ *  We have developed an own advanced viewer called ycomp:
+ *    http://www.info.uni-karlsruhe.de/software.php/id=6&lang=en
  *
- * Most routines use the name of the passed entity as the name of the
- * file dumped to.
+ *  Most routines use the name of the passed entity as the name of the
+ *  file dumped to.
  */
+#ifndef FIRM_IR_IRDUMP_H
+#define FIRM_IR_IRDUMP_H
 
-
-# ifndef _IRDUMP_H_
-# define _IRDUMP_H_
-
-# include "irnode.h"
-# include "irgraph.h"
-# include "irloop.h"
+#include "irnode.h"
+#include "irgraph.h"
+#include "irloop.h"
 
 /**
  * Names of the 32 supported colors
@@ -151,6 +159,18 @@ void set_dump_node_edge_hook(DUMP_NODE_EDGE_FUNC func);
  */
 DUMP_NODE_EDGE_FUNC get_dump_node_edge_hook(void);
 
+/**
+ * Set the hook to be called to dump additional edges to a block.
+ * @param func The hook to be called.
+ */
+void set_dump_block_edge_hook(DUMP_NODE_EDGE_FUNC func);
+
+/**
+ * Get the additional block edge dump hook.
+ * @return The current additional block edge dump hook.
+ */
+DUMP_NODE_EDGE_FUNC get_dump_block_edge_hook(void);
+
 /** Dump a firm graph.
  *
  *  @param irg     The firm graph to be dumped.
@@ -501,20 +521,20 @@ typedef enum {
 
 /** Write the entity and all its attributes to the passed file.
  *  */
-void    dump_entity_to_file (FILE *F, entity *ent, unsigned verbosity);
+void    dump_entity_to_file (FILE *F, ir_entity *ent, unsigned verbosity);
 
 /** Write the entity and all its attributes to the stdout.
  *
  *  Calls dump_entity_to_file().  */
-void    dump_entity (entity *ent);
+void    dump_entity (ir_entity *ent);
 
 /** Write the type and all its attributes to the file passed.
  * */
-void    dump_type_to_file (FILE *f, type *tp, dump_verbosity verbosity);
+void    dump_type_to_file (FILE *f, ir_type *tp, dump_verbosity verbosity);
 
 /** Write the type and all its attributes to stdout.
  *  */
-void    dump_type (type *tp);
+void    dump_type (ir_type *tp);
 
 
 /** Dump type information as text.
@@ -547,7 +567,7 @@ void dump_globals_as_text(unsigned verbosity, const char *suffix);
 /*                                    FLAGS                                     */
 /* **************************************************************************** */
 
-/** Output a selected graph.
+/** Set a prefix filter for output functions.
  *
  * All graph dumpers check this name.  If the name is != "" and
  * not a prefix of the graph to be dumped, the dumper does not
@@ -558,7 +578,7 @@ void dump_globals_as_text(unsigned verbosity, const char *suffix);
  */
 void   only_dump_method_with_name(ident *name);
 
-/** Returns the name set with only_dump_method_with_name(). */
+/** Returns the prefix filter set with only_dump_method_with_name(). */
 ident *get_dump_file_filter_ident(void);
 
 /** Returns true if dump file filter is not set, or if it is a
@@ -644,4 +664,35 @@ void dump_pointer_values_to_info(int flag);
  */
 void dump_ld_names(int flag);
 
-# endif /* _IRDUMP_H_ */
+/** Dumps all graph anchor nodes, even if they
+ * are dead.
+ *
+ * This option is off per default.
+ */
+void dump_all_anchors(int flag);
+
+/** A node info dumper callback. */
+typedef void (dump_node_info_cb_t)(void *data, FILE *f, const ir_node *n);
+
+/**
+ * Adds a new node info dumper callback. It is possible to add an unlimited
+ * number of callbacks. The callbacks are called at the end of the default
+ * info dumper.
+ *
+ * @param cb    the callback function to be called
+ * @param data  a context parameter
+ *
+ * @return A callback handle.
+ *
+ * @note This functionality is only available, if Firm hooks are enabled (default).
+ */
+void *dump_add_node_info_callback(dump_node_info_cb_t *cb, void *data);
+
+/**
+ * Remove a previously added info dumper callback.
+ *
+ * @param handle  the callback handle returned from dump_add_node_info_callback()
+ */
+void dump_remv_node_info_callback(void *handle);
+
+#endif