0cd976602cfe99353c8efa77ec9f3b9d6364f697
[libfirm] / ir / stat / pattern_dmp.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 #ifndef _PATTERN_DMP_H_
21 #define _PATTERN_DMP_H_
22
23 #include "counter.h"
24
25 typedef struct _pattern_dumper_t pattern_dumper_t;
26
27 /**
28  * Starts a new pattern.
29  */
30 void pattern_dump_new_pattern(pattern_dumper_t *self, counter_t *cnt);
31
32 /**
33  * Finish the current pattern.
34  */
35 void pattern_dump_finish_pattern(pattern_dumper_t *self);
36
37 /**
38  * Dumps a node.
39  */
40 void pattern_dump_node(pattern_dumper_t *self, unsigned id, unsigned op_code, unsigned mode_code, void *attr);
41
42 /**
43  * Dump a ref.
44  */
45 void pattern_dump_ref(pattern_dumper_t *self, unsigned id);
46
47 /**
48  * Dump an edge.
49  *
50  * @param tgt       The target ID
51  * @param src       The source ID
52  * @param pos       The edge position
53  * @param mode_code The mode_code of the edge
54  */
55 void pattern_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, unsigned pos, unsigned mode_code);
56
57 /**
58  * Start the children dumper.
59  */
60 void pattern_start_children(pattern_dumper_t *self, unsigned id);
61
62 /**
63  * Finish the children dumper.
64  */
65 void pattern_finish_children(pattern_dumper_t *self, unsigned id);
66
67 /**
68  * Finish the dumper, destroys the dumper object
69  */
70 void pattern_end(pattern_dumper_t *self);
71
72 /**
73  * Pattern dumper factory for text dumper.
74  */
75 pattern_dumper_t *new_text_dumper(void);
76
77 /**
78  * Pattern dumper factory for vcg dumper.
79  *
80  * @param vcg_name    name of the VCG file
81  * @param max_pattern maximum number of pattern to be dumped
82  */
83 pattern_dumper_t *new_vcg_dumper(const char *vcg_name, unsigned max_pattern);
84
85 #endif /* _PATTERN_DMP_H_ */