bepeephole: Inline be_peephole_new_node() into its only caller.
[libfirm] / ir / stat / pattern_dmp.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief   Statistics for Firm. Dumping patterns.
9  * @author  Michael Beck
10  */
11 #ifndef FIRM_STAT_PATTERN_DMP_H
12 #define FIRM_STAT_PATTERN_DMP_H
13
14 #include "counter.h"
15
16 typedef struct pattern_dumper_t pattern_dumper_t;
17
18 /**
19  * Starts a new pattern.
20  */
21 void pattern_dump_new_pattern(pattern_dumper_t *self, counter_t *cnt);
22
23 /**
24  * Finish the current pattern.
25  */
26 void pattern_dump_finish_pattern(pattern_dumper_t *self);
27
28 /**
29  * Dumps a node.
30  */
31 void pattern_dump_node(pattern_dumper_t *self, unsigned id, unsigned op_code, unsigned mode_code, void *attr);
32
33 /**
34  * Dump a ref.
35  */
36 void pattern_dump_ref(pattern_dumper_t *self, unsigned id);
37
38 /**
39  * Dump an edge.
40  *
41  * @param tgt       The target ID
42  * @param src       The source ID
43  * @param pos       The edge position
44  * @param mode_code The mode_code of the edge
45  */
46 void pattern_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, unsigned pos, unsigned mode_code);
47
48 /**
49  * Start the children dumper.
50  */
51 void pattern_start_children(pattern_dumper_t *self, unsigned id);
52
53 /**
54  * Finish the children dumper.
55  */
56 void pattern_finish_children(pattern_dumper_t *self, unsigned id);
57
58 /**
59  * Finish the dumper, destroys the dumper object
60  */
61 void pattern_end(pattern_dumper_t *self);
62
63 /**
64  * Pattern dumper factory for text dumper.
65  */
66 pattern_dumper_t *new_text_dumper(void);
67
68 /**
69  * Pattern dumper factory for vcg dumper.
70  *
71  * @param vcg_name    name of the VCG file
72  * @param max_pattern maximum number of pattern to be dumped
73  */
74 pattern_dumper_t *new_vcg_dumper(const char *vcg_name, unsigned max_pattern);
75
76 #endif /* FIRM_STAT_PATTERN_DMP_H */