merge kaps
[libfirm] / ir / stat / pattern_dmp.h
1 /*
2  * Copyright (C) 1995-2008 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 /**
21  * @file
22  * @brief   Statistics for Firm. Dumping patterns.
23  * @author  Michael Beck
24  * @version $Id$
25  */
26 #ifndef FIRM_STAT_PATTERN_DMP_H
27 #define FIRM_STAT_PATTERN_DMP_H
28
29 #include "counter.h"
30
31 typedef struct pattern_dumper_t pattern_dumper_t;
32
33 /**
34  * Starts a new pattern.
35  */
36 void pattern_dump_new_pattern(pattern_dumper_t *self, counter_t *cnt);
37
38 /**
39  * Finish the current pattern.
40  */
41 void pattern_dump_finish_pattern(pattern_dumper_t *self);
42
43 /**
44  * Dumps a node.
45  */
46 void pattern_dump_node(pattern_dumper_t *self, unsigned id, unsigned op_code, unsigned mode_code, void *attr);
47
48 /**
49  * Dump a ref.
50  */
51 void pattern_dump_ref(pattern_dumper_t *self, unsigned id);
52
53 /**
54  * Dump an edge.
55  *
56  * @param tgt       The target ID
57  * @param src       The source ID
58  * @param pos       The edge position
59  * @param mode_code The mode_code of the edge
60  */
61 void pattern_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, unsigned pos, unsigned mode_code);
62
63 /**
64  * Start the children dumper.
65  */
66 void pattern_start_children(pattern_dumper_t *self, unsigned id);
67
68 /**
69  * Finish the children dumper.
70  */
71 void pattern_finish_children(pattern_dumper_t *self, unsigned id);
72
73 /**
74  * Finish the dumper, destroys the dumper object
75  */
76 void pattern_end(pattern_dumper_t *self);
77
78 /**
79  * Pattern dumper factory for text dumper.
80  */
81 pattern_dumper_t *new_text_dumper(void);
82
83 /**
84  * Pattern dumper factory for vcg dumper.
85  *
86  * @param vcg_name    name of the VCG file
87  * @param max_pattern maximum number of pattern to be dumped
88  */
89 pattern_dumper_t *new_vcg_dumper(const char *vcg_name, unsigned max_pattern);
90
91 #endif /* FIRM_STAT_PATTERN_DMP_H */