libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
irdump.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5 
13 #ifndef FIRM_IR_IRDUMP_H
14 #define FIRM_IR_IRDUMP_H
15 
16 #include <stdio.h>
17 
18 #include "firm_types.h"
19 #include "begin.h"
20 
47 FIRM_API void dump_ir_graph(ir_graph *graph, const char *suffix);
48 
52 typedef void (*ir_prog_dump_func)(FILE *out);
53 
67 FIRM_API void dump_ir_prog_ext(ir_prog_dump_func func, const char *suffix);
68 
72 typedef void (*ir_graph_dump_func)(FILE *out, ir_graph *graph);
73 
86 FIRM_API void dump_ir_graph_ext(ir_graph_dump_func func, ir_graph *graph,
87  const char *suffix);
88 
94 FIRM_API void dump_all_ir_graphs(const char *suffix);
95 
99 FIRM_API void ir_set_dump_path(const char *path);
100 
110 FIRM_API void ir_set_dump_filter(const char *name);
111 
113 FIRM_API const char *ir_get_dump_filter(void);
114 
124 FIRM_API void dump_ir_graph_file(FILE *out, ir_graph *graph);
125 
134 FIRM_API void dump_cfg(FILE *out, ir_graph *graph);
135 
141 FIRM_API void dump_callgraph(FILE *out);
142 
151 FIRM_API void dump_typegraph(FILE *out);
152 
164 FIRM_API void dump_class_hierarchy(FILE *out);
165 
173 FIRM_API void dump_loop_tree(FILE *out, ir_graph *graph);
174 
180 FIRM_API void dump_callgraph_loop_tree(FILE *out);
181 
190 FIRM_API void dump_types_as_text(FILE *out);
191 
199 FIRM_API void dump_globals_as_text(FILE *out);
200 
207 FIRM_API void dump_loop(FILE *out, ir_loop *loop);
208 
211 FIRM_API void dump_graph_as_text(FILE *out, const ir_graph *graph);
212 
214 FIRM_API void dump_entity_to_file(FILE *out, const ir_entity *entity);
215 
217 FIRM_API void dump_type_to_file(FILE *out, const ir_type *type);
218 
220 typedef enum {
223  dump_verbosity_fields = 0x00000002,
224  dump_verbosity_methods = 0x00000004,
225  dump_verbosity_nostatic = 0x00000040,
229  dump_verbosity_entattrs = 0x00000010,
234  dump_verbosity_max = 0x4FF00FBE
236 ENUM_BITSET(ir_dump_verbosity_t)
237 
238 
239 FIRM_API void ir_set_dump_verbosity(ir_dump_verbosity_t verbosity);
242 
248 typedef enum {
273  ir_dump_flag_loops = 1U << 10,
284 
292 ENUM_BITSET(ir_dump_flags_t)
293 
294 
295 FIRM_API void ir_set_dump_flags(ir_dump_flags_t flags);
297 FIRM_API void ir_add_dump_flags(ir_dump_flags_t flags);
299 FIRM_API void ir_remove_dump_flags(ir_dump_flags_t flags);
301 FIRM_API ir_dump_flags_t ir_get_dump_flags(void);
302 
308 typedef int (*dump_node_vcgattr_func)(FILE *out, const ir_node *node, const ir_node *local);
309 
315 typedef int (*dump_edge_vcgattr_func)(FILE *out, const ir_node *node, int to);
316 
321 typedef void (*dump_node_edge_func)(FILE *out, const ir_node *node);
322 
327 
332 FIRM_API void set_dump_node_edge_hook(dump_node_edge_func func);
333 
339 
345 
351 
353 typedef void (dump_node_info_cb_t)(void *data, FILE *out, const ir_node *n);
354 
367 FIRM_API hook_entry_t *dump_add_node_info_callback(dump_node_info_cb_t *cb, void *data);
368 
375 FIRM_API void dump_remove_node_info_callback(hook_entry_t *handle);
376 
379 #include "end.h"
380 
381 #endif
void dump_ir_prog_ext(ir_prog_dump_func func, const char *suffix)
Convenience interface for dumping the whole compilation-unit/program.
void dump_loop_tree(FILE *out, ir_graph *graph)
Dump a standalone loop tree, which contains the loop nodes and the firm nodes belonging to one loop p...
struct ir_type ir_type
Type.
Definition: firm_types.h:71
if set dumps edges from blocks to their immediate dominator
Definition: irdump.h:270
void ir_set_dump_filter(const char *name)
Sets a prefix filter for output functions.
Turn everything on.
Definition: irdump.h:234
dump (parts of) typegraph along with nodes
Definition: irdump.h:252
void dump_all_ir_graphs(const char *suffix)
A walker that calls a dumper for each graph in the program.
void(* ir_prog_dump_func)(FILE *out)
type for dumpers that dump information about the whole program
Definition: irdump.h:52
dump entities in class hierarchies
Definition: irdump.h:290
void( dump_node_info_cb_t)(void *data, FILE *out, const ir_node *n)
A node info dumper callback.
Definition: irdump.h:353
struct ir_graph ir_graph
Procedure Graph.
Definition: firm_types.h:74
Dump types and fields (like a type declaration).
Definition: irdump.h:223
void dump_ir_graph_ext(ir_graph_dump_func func, ir_graph *graph, const char *suffix)
Convenience interface for dumping graphs.
Sets the vcg flag "display_edge_labels" to no.
Definition: irdump.h:256
void set_dump_node_vcgattr_hook(dump_node_vcgattr_func hook)
Sets the node_vcgattr hook.
void dump_graph_as_text(FILE *out, const ir_graph *graph)
Write the graph and all its attributes to the file passed.
void dump_cfg(FILE *out, ir_graph *graph)
Dump the control flow graph of a procedure.
struct ir_loop ir_loop
Loop.
Definition: firm_types.h:80
void dump_globals_as_text(FILE *out)
Dumps all global variables as text.
Dump entity constants.
Definition: irdump.h:230
void dump_callgraph(FILE *out)
Dump the call graph.
void ir_set_dump_verbosity(ir_dump_verbosity_t verbosity)
override currently set text dump flags with new ones
void dump_entity_to_file(FILE *out, const ir_entity *entity)
Write the entity and all its attributes to the passed file.
void set_dump_node_edge_hook(dump_node_edge_func func)
Sets the hook to be called to dump additional edges to a node.
void dump_remove_node_info_callback(hook_entry_t *handle)
Remove a previously added info dumper callback.
void ir_set_dump_flags(ir_dump_flags_t flags)
override currently set dump flags with new ones
If set constants will be replicated for every use.
Definition: irdump.h:260
Only dump names.
Definition: irdump.h:221
void ir_set_dump_path(const char *path)
Specifies output path for the dump_ir_graph function.
void dump_typegraph(FILE *out)
Dumps all type information.
void dump_type_to_file(FILE *out, const ir_type *type)
Write the type and all its attributes to the file passed.
dumps marked blocks with an asterisk in the label
Definition: irdump.h:283
void set_dump_block_edge_hook(dump_node_edge_func func)
Sets the hook to be called to dump additional edges to a block.
int(* dump_edge_vcgattr_func)(FILE *out, const ir_node *node, int to)
This hook is called to dump the vcg attributes of an edge to a file.
Definition: irdump.h:315
ir_dump_verbosity_t ir_get_dump_verbosity(void)
return currently set text dump flags
turns of dumping of constant entity values in typegraphs
Definition: irdump.h:286
dump_node_edge_func get_dump_node_edge_hook(void)
Returns the additional edge dump hook.
Dump types and dynamic allocated fields (like a type declaration).
Definition: irdump.h:225
show keepalive edges from the end node
Definition: irdump.h:266
struct ir_entity ir_entity
Entity.
Definition: firm_types.h:83
void dump_ir_graph_file(FILE *out, ir_graph *graph)
Dumps all Firm nodes of a single graph for a single procedure in standard xvcg format.
void dump_loop(FILE *out, ir_loop *loop)
Dumps the firm nodes in the sub-loop-tree of loop to a vcg file.
void ir_remove_dump_flags(ir_dump_flags_t flags)
disable certain dump flags
Dump types and methods (like a type declaration).
Definition: irdump.h:224
dump_node_edge_func get_dump_block_edge_hook(void)
Returns the additional block edge dump hook.
If set the dumper dumps loop nodes and edges from these nodes to the contained ir nodes...
Definition: irdump.h:273
if set node number will be added to node labels
Definition: irdump.h:264
dump backedges from iredges.h
Definition: irdump.h:277
void ir_add_dump_flags(ir_dump_flags_t flags)
add flags to the currently set dump flags
Dump entity access statistics.
Definition: irdump.h:232
dump all anchor nodes, even the unused ones
Definition: irdump.h:281
int(* dump_node_vcgattr_func)(FILE *out, const ir_node *node, const ir_node *local)
This hook is called to dump the vcg attributes of a node to a file.
Definition: irdump.h:308
write node addresses into the vcg info
Definition: irdump.h:279
Dump all type attributes.
Definition: irdump.h:228
void dump_types_as_text(FILE *out)
Dump type information as text.
if set (and backedge info is computed) dump backedges
Definition: irdump.h:275
void dump_class_hierarchy(FILE *out)
Dumps the class hierarchy with or without entities.
dump basic blocks as subgraphs which contain the nodes in the block
Definition: irdump.h:250
void(* dump_node_edge_func)(FILE *out, const ir_node *node)
This hook allows dumping of additional edges (it is called outside a node: {} environment) ...
Definition: irdump.h:321
Dump all entity attributes.
Definition: irdump.h:229
struct ir_node ir_node
Procedure Graph Node.
Definition: firm_types.h:53
void set_dump_edge_vcgattr_hook(dump_edge_vcgattr_func hook)
Sets the edge_vcgattr hook.
ir_dump_flags_t ir_get_dump_flags(void)
return currently set dump flags
if set node idx will be added to node labels
Definition: irdump.h:262
const char * ir_get_dump_filter(void)
Returns the prefix filter set with ir_set_dump_filter.
void dump_ir_graph(ir_graph *graph, const char *suffix)
Convenience interface for dumping a graph as vcg file.
void(* ir_graph_dump_func)(FILE *out, ir_graph *graph)
type for graph dumpers
Definition: irdump.h:72
ir_dump_flags_t
A bitset indicating various options that affect what information is dumped and how exactly it is dump...
Definition: irdump.h:248
ir_dump_verbosity_t
Verbosity for text dumpers.
Definition: irdump.h:220
hook_entry_t * dump_add_node_info_callback(dump_node_info_cb_t *cb, void *data)
Adds a new node info dumper callback.
void dump_callgraph_loop_tree(FILE *out)
Dumps the loop tree over the call graph.
dumps ld_names of entities instead of their names
Definition: irdump.h:288
dump out edges
Definition: irdump.h:268