moved firmext code into the backend dir
[libfirm] / ir / be / grgen / match_t.h
1 #ifndef _EXT_GRS_MATCH_T_H_
2 #define _EXT_GRS_MATCH_T_H_
3
4 /*
5  * Project:     libFIRM/extension module/graph rewriting system
6  * File name:   ext/grs/match_t.h
7  * Purpose:     provides the libfirm internal version of the interface
8  *              for subgraph matching
9  * Author:      Veit Batz
10  * Created:             7. Junly 2005
11  * CVS-ID:      $Id$
12  * Copyright:   (c) 2005 Universität Karlsruhe
13  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
14  */
15
16 #include "common_t.h"
17 #include "matchplan_t.h"
18
19 #include "match.h"
20
21
22 /** graph matching result */
23 struct _ext_grs_match_t {
24         /** the action this match belongs to */
25         ext_grs_action_t *action;
26         /** the host graph matched in */
27         ir_graph *irg;
28         /** flag: match valid */
29         int compliant;
30         /** the number of matches found */
31         int n_matches;
32         /** the number of nodes in each match */
33         int n_nodes;
34         /** the number of edges in each match */
35         int n_edges;
36         /** maximum node id in this match */
37         int max_node_id;
38         /** maximum edge id in this match */
39         int max_edge_id;
40         /** array of arrays, each mapping node/edge ids to (ir_node*),
41          *  the length is max_node_id + 1 */
42         ir_node ***nodes;
43         /** array of arrays, each mapping edge ids to (ir_node*),
44          *  the length is max_edge_id + 1 */
45         const ir_edge_t ***edges;
46         /** array of arrays, each mapping replace_node/edge ids to (ir_node*) */
47         ir_node ***repl_nodes;
48         /** internal obstack of the match object */
49         struct obstack obst;
50 };
51
52 /** wraps initial bindings for pivoted graph matching */
53 struct _ext_grs_binding_t {
54         /** number of bound host graph fragments */
55         int size;
56         /** number of involved pattern nodes */
57         int n_nodes;
58         /** number of involved pattern edges */
59         int n_edges;
60         /** the bound pattern nodes */
61         ext_grs_node_t *pat_nodes;
62         /** the bound pattern edges */
63         ext_grs_edge_t *pat_edges;
64         /** the ir nodes bound to the pattern nodes given by their index (node map) */
65         ir_node ***nodes;
66         /** the ir edges bound to the pattern edges given by their index (edge map) */
67         ir_edge_t ***edges;
68 };
69
70
71 void _ext_grs_match_init(void);
72
73
74
75 #endif /*_EXT_GRS_MATCH_T_H_*/