libFirm

Dumps information so it can be visualised. More...

Modules

 Convenience Interface
 
 Low Level Interface
 This interface exists to enable some custom vcg formatting/slicing used to produce example images for the homepage.
 

Typedefs

typedef 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. More...
 
typedef 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. More...
 
typedef 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) More...
 
typedef void( dump_node_info_cb_t) (void *data, FILE *out, const ir_node *n)
 A node info dumper callback. More...
 

Enumerations

enum  ir_dump_verbosity_t {
  dump_verbosity_onlynames = 0x00000001, dump_verbosity_fields = 0x00000002, dump_verbosity_methods = 0x00000004, dump_verbosity_nostatic = 0x00000040,
  dump_verbosity_typeattrs = 0x00000008, dump_verbosity_entattrs = 0x00000010, dump_verbosity_entconsts = 0x00000020, dump_verbosity_accessStats = 0x00000100,
  dump_verbosity_max = 0x4FF00FBE
}
 Verbosity for text dumpers. More...
 
enum  ir_dump_flags_t {
  ir_dump_flag_blocks_as_subgraphs = 1U << 0, ir_dump_flag_with_typegraph = 1U << 1, ir_dump_flag_disable_edge_labels = 1U << 2, ir_dump_flag_consts_local = 1U << 3,
  ir_dump_flag_idx_label = 1U << 4, ir_dump_flag_number_label = 1U << 5, ir_dump_flag_keepalive_edges = 1U << 6, ir_dump_flag_out_edges = 1U << 7,
  ir_dump_flag_dominance = 1U << 8, ir_dump_flag_loops = 1U << 9, ir_dump_flag_back_edges = 1U << 10, ir_dump_flag_iredges = 1U << 11,
  ir_dump_flag_all_anchors = 1U << 12, ir_dump_flag_show_marks = 1U << 13, ir_dump_flag_no_entity_values = 1U << 14, ir_dump_flag_ld_names = 1U << 15,
  ir_dump_flag_entities_in_hierarchy = 1U << 16
}
 A bitset indicating various options that affect what information is dumped and how exactly it is dumped. More...
 

Functions

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. More...
 
void dump_cfg (FILE *out, ir_graph *graph)
 Dump the control flow graph of a procedure. More...
 
void dump_callgraph (FILE *out)
 Dump the call graph. More...
 
void dump_typegraph (FILE *out)
 Dumps all type information. More...
 
void dump_class_hierarchy (FILE *out)
 Dumps the class hierarchy with or without entities. More...
 
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 packed together in one subgraph. More...
 
void dump_callgraph_loop_tree (FILE *out)
 Dumps the loop tree over the call graph. More...
 
void dump_types_as_text (FILE *out)
 Dump type information as text. More...
 
void dump_globals_as_text (FILE *out)
 Dumps all global variables as text. More...
 
void dump_loop (FILE *out, ir_loop *loop)
 Dumps the firm nodes in the sub-loop-tree of loop to a vcg file. More...
 
void dump_graph_as_text (FILE *out, const ir_graph *graph)
 Write the graph and all its attributes to the file passed. More...
 
void dump_entity_to_file (FILE *out, const ir_entity *entity)
 Write the entity and all its attributes to the passed file. More...
 
void dump_type_to_file (FILE *out, const ir_type *type)
 Write the type and all its attributes to the file passed. More...
 
void ir_set_dump_verbosity (ir_dump_verbosity_t verbosity)
 override currently set text dump flags with new ones More...
 
ir_dump_verbosity_t ir_get_dump_verbosity (void)
 return currently set text dump flags More...
 
void ir_set_dump_flags (ir_dump_flags_t flags)
 override currently set dump flags with new ones More...
 
void ir_add_dump_flags (ir_dump_flags_t flags)
 add flags to the currently set dump flags More...
 
void ir_remove_dump_flags (ir_dump_flags_t flags)
 disable certain dump flags More...
 
ir_dump_flags_t ir_get_dump_flags (void)
 return currently set dump flags More...
 
void set_dump_node_vcgattr_hook (dump_node_vcgattr_func hook)
 Sets the node_vcgattr hook. More...
 
void set_dump_edge_vcgattr_hook (dump_edge_vcgattr_func hook)
 Sets the edge_vcgattr hook. More...
 
void set_dump_node_edge_hook (dump_node_edge_func func)
 Sets the hook to be called to dump additional edges to a node. More...
 
dump_node_edge_func get_dump_node_edge_hook (void)
 Returns the additional edge dump hook. More...
 
void set_dump_block_edge_hook (dump_node_edge_func func)
 Sets the hook to be called to dump additional edges to a block. More...
 
dump_node_edge_func get_dump_block_edge_hook (void)
 Returns the additional block edge dump hook. More...
 
hook_entry_t * dump_add_node_info_callback (dump_node_info_cb_t *cb, void *data)
 Adds a new node info dumper callback. More...
 
void dump_remove_node_info_callback (hook_entry_t *handle)
 Removes a previously added info dumper callback. More...
 

Detailed Description

Dumps information so it can be visualised.

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.

We have developed an own advanced viewer called ycomp: http://www.info.uni-karlsruhe.de/software/ycomp/

Typedef Documentation

typedef 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.

If this function returns zero, the default attributes are added, else removed.

Definition at line 310 of file irdump.h.

typedef 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 at line 316 of file irdump.h.

typedef void( dump_node_info_cb_t) (void *data, FILE *out, const ir_node *n)

A node info dumper callback.

Definition at line 348 of file irdump.h.

typedef 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.

If this function returns zero, the default attributes are added, else removed.

Definition at line 303 of file irdump.h.

Enumeration Type Documentation

A bitset indicating various options that affect what information is dumped and how exactly it is dumped.

This affects the dumpers that produce vcg graphs.

Enumerator
ir_dump_flag_blocks_as_subgraphs 

dump basic blocks as subgraphs which contain the nodes in the block

ir_dump_flag_with_typegraph 

dump (parts of) typegraph along with nodes

ir_dump_flag_disable_edge_labels 

Sets the vcg flag "display_edge_labels" to no.

This is necessary as xvcg fails to display graphs with self-edges if these edges have labels.

ir_dump_flag_consts_local 

If set constants will be replicated for every use.

In non blocked view edges from constant to block are skipped. Vcg then layouts the graphs more compact, this makes them better readable.

ir_dump_flag_idx_label 

if set node idx will be added to node labels

ir_dump_flag_number_label 

if set node number will be added to node labels

ir_dump_flag_keepalive_edges 

show keepalive edges from the end node

ir_dump_flag_out_edges 

dump out edges

ir_dump_flag_dominance 

if set dumps edges from blocks to their immediate dominator

ir_dump_flag_loops 

If set the dumper dumps loop nodes and edges from these nodes to the contained ir nodes.

ir_dump_flag_back_edges 

if set (and backedge info is computed) dump backedges

ir_dump_flag_iredges 

dump backedges from iredges.h

ir_dump_flag_all_anchors 

dump all anchor nodes, even the unused ones

ir_dump_flag_show_marks 

dumps marked blocks with an asterisk in the label

ir_dump_flag_no_entity_values 

turns of dumping of constant entity values in typegraphs

ir_dump_flag_ld_names 

dumps ld_names of entities instead of their names

ir_dump_flag_entities_in_hierarchy 

dump entities in class hierarchies

Definition at line 245 of file irdump.h.

Verbosity for text dumpers.

Enumerator
dump_verbosity_onlynames 

Only dump names.

Turns off all other flags up to 0x00010000.

dump_verbosity_fields 

Dump types and fields (like a type declaration).

dump_verbosity_methods 

Dump types and methods (like a type declaration).

dump_verbosity_nostatic 

Dump types and dynamic allocated fields (like a type declaration).

This excludes methods and static, polymorphic fields.

dump_verbosity_typeattrs 

Dump all type attributes.

dump_verbosity_entattrs 

Dump all entity attributes.

dump_verbosity_entconsts 

Dump entity constants.

dump_verbosity_accessStats 

Dump entity access statistics.

dump_verbosity_max 

Turn everything on.

Definition at line 217 of file irdump.h.

Function Documentation

hook_entry_t* dump_add_node_info_callback ( dump_node_info_cb_t cb,
void *  data 
)

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.

Parameters
cbthe callback function to be called
dataa context parameter
Returns
A callback handle.
Note
This functionality is only available, if Firm hooks are enabled.
void dump_callgraph ( FILE *  out)

Dump the call graph.

Parameters
outOutput stream the callgraph is written to
void dump_callgraph_loop_tree ( FILE *  out)

Dumps the loop tree over the call graph.

Parameters
outOutput stream
void dump_cfg ( FILE *  out,
ir_graph graph 
)

Dump the control flow graph of a procedure.

Parameters
graphThe firm graph whose CFG shall be dumped.
outOutput stream the CFG is written to

Dumps the control flow graph of a procedure in standard xvcg format.

void dump_class_hierarchy ( FILE *  out)

Dumps the class hierarchy with or without entities.

Parameters
outOutput stream

Does not dump the global type. Dumps a node for all classes and the sub/supertype relations. If entities is set to true also dumps the entities of classes, but without any additional information as the entities type. The overwrites relation is dumped along with the entities.

void dump_entity_to_file ( FILE *  out,
const ir_entity entity 
)

Write the entity and all its attributes to the passed file.

void dump_globals_as_text ( FILE *  out)

Dumps all global variables as text.

Parameters
outOutput stream

Dumps a text representation of the entities in the global type.

void dump_graph_as_text ( FILE *  out,
const ir_graph graph 
)

Write the graph and all its attributes to the file passed.

Does not write the nodes.

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.

Parameters
graphThe firm graph to be dumped.
outOutput stream the graph is written to
void dump_loop ( FILE *  out,
ir_loop loop 
)

Dumps the firm nodes in the sub-loop-tree of loop to a vcg file.

Parameters
outOutput stream
loopDump the loop tree for this loop.
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 packed together in one subgraph.

Parameters
outOutput stream
graphDump the loop tree for this graph.
void dump_remove_node_info_callback ( hook_entry_t *  handle)

Removes a previously added info dumper callback.

Parameters
handlethe callback handle returned from dump_add_node_info_callback()
void dump_type_to_file ( FILE *  out,
const ir_type type 
)

Write the type and all its attributes to the file passed.

void dump_typegraph ( FILE *  out)

Dumps all type information.

Parameters
outOutput stream the typegraph is written to

Dumps all type information that is somehow reachable in standard vcg format.

void dump_types_as_text ( FILE *  out)

Dump type information as text.

Often type graphs are unhandy in their vcg representation. The text dumper represents the information for a single type more compact, but the relations between the types only implicitly. Dumps only 'real' types, i.e., those in the type list. Does not dump the global type nor frame types or the like.

dump_node_edge_func get_dump_block_edge_hook ( void  )

Returns the additional block edge dump hook.

Returns
The current additional block edge dump hook.
dump_node_edge_func get_dump_node_edge_hook ( void  )

Returns the additional edge dump hook.

Returns
The current additional edge dump hook.]
void ir_add_dump_flags ( ir_dump_flags_t  flags)

add flags to the currently set dump flags

ir_dump_flags_t ir_get_dump_flags ( void  )

return currently set dump flags

ir_dump_verbosity_t ir_get_dump_verbosity ( void  )

return currently set text dump flags

void ir_remove_dump_flags ( ir_dump_flags_t  flags)

disable certain dump flags

void ir_set_dump_flags ( ir_dump_flags_t  flags)

override currently set dump flags with new ones

void ir_set_dump_verbosity ( ir_dump_verbosity_t  verbosity)

override currently set text dump flags with new ones

void set_dump_block_edge_hook ( dump_node_edge_func  func)

Sets the hook to be called to dump additional edges to a block.

Parameters
funcThe hook to be called.
void set_dump_edge_vcgattr_hook ( dump_edge_vcgattr_func  hook)

Sets the edge_vcgattr hook.

void set_dump_node_edge_hook ( dump_node_edge_func  func)

Sets the hook to be called to dump additional edges to a node.

Parameters
funcThe hook to be called.
void set_dump_node_vcgattr_hook ( dump_node_vcgattr_func  hook)

Sets the node_vcgattr hook.