Predator
[unstable] git snapshot
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
adt_op_match.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2013 Kamil Dudka <kdudka@redhat.com>
3
*
4
* This file is part of predator.
5
*
6
* predator is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* any later version.
10
*
11
* predator is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with predator. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef H_GUARD_ADT_OP_MATCH_H
21
#define H_GUARD_ADT_OP_MATCH_H
22
23
#include "
adt_op.hh
"
24
#include "
fixed_point.hh
"
25
#include "
fixed_point_rewrite.hh
"
// for FixedPoint::IStateRewriter
26
27
#include <list>
28
29
namespace
AdtOp {
30
31
typedef
FixedPoint::IStateRewriter
TInsnWriter
;
32
33
enum
EFootprintPort
{
34
FP_SRC
,
35
FP_DST
,
36
FP_TOTAL
37
};
38
39
typedef
std::list<FixedPoint::THeapIdent>
THeapIdentSeq
;
40
41
struct
FootprintMatch
{
42
TFootprintIdent
footprint
;
43
ShapeProps
props
;
44
ShapeProps
tplProps
;
45
46
/// list of locations (instructions) matched by the template + dst location
47
THeapIdentSeq
matchedHeaps
;
48
49
/// list of instructions included as not implementing the operation
50
THeapIdentSeq
skippedHeaps
;
51
52
FixedPoint::TObjectMapper
objMap
[
FP_TOTAL
];
53
54
FootprintMatch
(
const
TFootprintIdent
footprint_):
55
footprint
(footprint_)
56
{
57
}
58
};
59
60
typedef
std::vector<FootprintMatch>
TMatchList
;
61
typedef
FixedPoint::GlobalState
TProgState
;
62
63
void
matchTemplates
(
64
TMatchList
*pDst,
65
const
OpCollection
&coll,
66
const
TProgState
&progState);
67
68
typedef
std::vector<FixedPoint::TLocIdx>
TInsnList
;
69
typedef
std::vector<TInsnList>
TInsnListByTplIdx
;
70
71
void
collectReplacedInsns
(
72
TInsnListByTplIdx
*pDst,
73
const
TMatchList
&matchList,
74
const
TProgState
&progState);
75
76
void
selectApplicableMatches
(
77
TMatchList
*pMatchList,
78
const
TProgState
&progState);
79
80
TObjId
selectMappedObjByTs
(
81
const
SymHeap
&sh,
82
const
BindingOff
&bOff,
83
const
TObjList
&objList,
84
ETargetSpecifier
ts);
85
86
typedef
int
TOpIdx
;
87
typedef
int
TMatchIdx
;
88
typedef
std::vector<TMatchIdx>
TMatchIdxList
;
89
typedef
std::vector<TMatchIdxList>
TOpList
;
90
91
bool
collectOpList
(
92
TOpList
*pDst,
93
const
TMatchList
&matchList);
94
95
}
// namespace AdtOp
96
97
#endif
/* H_GUARD_ADT_OP_MATCH_H */
Generated on Mon Nov 9 2015 14:51:59 for Predator by
1.8.1.2