LLVM: include/llvm/TableGen/SetTheory.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47#ifndef LLVM_TABLEGEN_SETTHEORY_H
48#define LLVM_TABLEGEN_SETTHEORY_H
49
55#include
56#include
57#include
58
59namespace llvm {
60
64
66public:
67 using RecVec = std::vector<const Record *>;
69
70
72 virtual void anchor();
73
74 public:
76
77
78
81 };
82
83
84
85
87 virtual void anchor();
88
89 public:
91
93 };
94
95private:
96
97
98 using ExpandMap = std::map<const Record *, RecVec>;
99 ExpandMap Expansions;
100
101
103
104
106
107public:
108
110
111
113
114
115
116
117
118
119
120
121
123
124
126
127
129
130
131 template
133 while (begin != end)
135 }
136
137
138
139
141};
142
143}
144
145#endif
This file defines the StringMap class.
This file implements a set that has insertion order iteration characteristics.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
(v a, b) - Represent a DAG tree value.
Expander - A callback function that can transform a Record representing a set into a fully expanded l...
Definition SetTheory.h:86
virtual void expand(SetTheory &, const Record *, RecSet &Elts)=0
virtual ~Expander()=default
Operator - A callback representing a DAG operator.
Definition SetTheory.h:71
virtual void apply(SetTheory &, const DagInit *Expr, RecSet &Elts, ArrayRef< SMLoc > Loc)=0
apply - Apply this operator to Expr's arguments and insert the result in Elts.
virtual ~Operator()=default
void addOperator(StringRef Name, std::unique_ptr< Operator >)
addOperator - Add a DAG operator.
SetTheory()
Create a SetTheory instance with only the standard operators.
const RecVec * expand(const Record *Set)
expand - Expand a record into a set of elements if possible.
SmallSetVector< const Record *, 16 > RecSet
Definition SetTheory.h:68
void evaluate(Iter begin, Iter end, RecSet &Elts, ArrayRef< SMLoc > Loc)
evaluate - Evaluate a sequence of Inits and append to Elts.
Definition SetTheory.h:132
void evaluate(const Init *Expr, RecSet &Elts, ArrayRef< SMLoc > Loc)
evaluate - Evaluate Expr and append the resulting set to Elts.
std::vector< const Record * > RecVec
Definition SetTheory.h:67
void addFieldExpander(StringRef ClassName, StringRef FieldName)
addFieldExpander - Add an expander for ClassName that simply evaluates FieldName in the Record to get...
void addExpander(StringRef ClassName, std::unique_ptr< Expander >)
addExpander - Add an expander for Records with the named super class.
A SetVector that performs no allocations if smaller than a certain size.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.