cleaned up the order of ifdef's
[libfirm] / ir / common / firmwalk.h
index 56ce822..6fce4eb 100644 (file)
 #ifndef _FIRM_WALK_H_
 #define _FIRM_WALK_H_
 
-#include "type.h"
-#include "irgraph.h"
-#include "typewalk.h"
+#include "firm_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 /** Returns the link of a firm node.
  *  Possible firm structures are: entity, type, ir_graph, ir_node and
@@ -45,7 +48,7 @@
  *  by this firm walker to collect walking data.
  *
  *  @param thing Pointer to a firm structure
- *  @retrun Link pointer
+ *  @return Link pointer
  *
  *  @note After calling firm_walk_finalize() the stored link
  *        information may be invalid. */
@@ -59,7 +62,7 @@ void *get_firm_walk_link(void *thing);
  *  to a firm structure. The real link field of firm structure is used
  *  by this firm walker to collect walking data.
  *
- *  @param thing firm structur
+ *  @param thing firm structure
  *  @param link Pointer to link field
  *
  *  @note After calling firm_walk_finalize() the stored link
@@ -74,7 +77,7 @@ typedef void firm_walk_finalize_func(void *env);
 /** Mode callback function definition */
 typedef void firm_walk_mode_func(ir_mode *mode, void *env);
 /** Type callback function definition */
-typedef void firm_walk_type_func(type *tp, void *env);
+typedef void firm_walk_type_func(ir_type *tp, void *env);
 /** Entity callback function definition */
 typedef void firm_walk_entity_func(entity *ent, void *env);
 /** Graph callback function definition */
@@ -123,7 +126,7 @@ typedef struct
   /* @{ */
   /** Interface to dump all collected types.
    *
-   *  @node To dump all (not only used types by default) a special walk
+   *  @note To dump all (not only used types by default) a special walk
    *        flag must be set for the walker initializer */
   firm_walk_init_func *do_type_init;
   firm_walk_type_func *do_type;
@@ -141,8 +144,9 @@ typedef struct
    *
    *  The firm walker dump a graph with its blocks and nodes nested.
    *  Fist do_graph_init will be called (if defined). For each graph
-   *  do_graph will be call in a loop. After dumped all graphs,
-   *  do_graph_finalize will be called.
+   *  do_graph will be call in a loop.
+   *  After all blocks in a graph are dumped, do_graph_post() is called.
+   *  After dumped all graphs, do_graph_finalize will be called.
    *
    *  Within do_graph each block will be dumped. First do_block_init,
    *  for each block do_block and after all dumped blocks
@@ -154,6 +158,7 @@ typedef struct
    *  walking flag, a prefix order is also possible. */
   firm_walk_init_func *do_graph_init;
   firm_walk_graph_func *do_graph;
+  firm_walk_graph_func *do_graph_post;
   firm_walk_finalize_func *do_graph_finalize;
 
   /* @{ */
@@ -162,6 +167,7 @@ typedef struct
    *  @see do_graph */
   firm_walk_block_init_func *do_block_init;
   firm_walk_block_func *do_block;
+  firm_walk_block_func *do_block_post;
   firm_walk_block_finalize_func *do_block_finalize;
   /* @} */
 
@@ -205,4 +211,9 @@ void firm_walk(firm_walk_interface *wif);
 /** Finalize the walker and frees all stored data for dumping */
 void firm_walk_finalize(void);
 
+#ifdef __cplusplus
+}
+#endif
+
+
 #endif /* _FIRM_WALK_H_ */