@@ -73,21 +73,21 @@ class OpBuildGenTest : public ::testing::Test {
73
73
template <typename OpTy>
74
74
void testSingleVariadicInputInferredType () {
75
75
// Test separate arg, separate param build method.
76
- auto op = builder.create <OpTy>(loc, i32Ty, ValueRange{cstI32, cstI32});
77
- verifyOp (std::move (op), {i32Ty}, {cstI32, cstI32}, noAttrs);
76
+ auto op = builder.create <OpTy>(loc, i32Ty, ValueRange{* cstI32, * cstI32});
77
+ verifyOp (std::move (op), {i32Ty}, {* cstI32, * cstI32}, noAttrs);
78
78
79
79
// Test collective params build method.
80
80
op =
81
- builder.create <OpTy>(loc, TypeRange{i32Ty}, ValueRange{cstI32, cstI32});
82
- verifyOp (std::move (op), {i32Ty}, {cstI32, cstI32}, noAttrs);
81
+ builder.create <OpTy>(loc, TypeRange{i32Ty}, ValueRange{* cstI32, * cstI32});
82
+ verifyOp (std::move (op), {i32Ty}, {* cstI32, * cstI32}, noAttrs);
83
83
84
84
// Test build method with no result types, default value of attributes.
85
- op = builder.create <OpTy>(loc, ValueRange{cstI32, cstI32});
86
- verifyOp (std::move (op), {i32Ty}, {cstI32, cstI32}, noAttrs);
85
+ op = builder.create <OpTy>(loc, ValueRange{* cstI32, * cstI32});
86
+ verifyOp (std::move (op), {i32Ty}, {* cstI32, * cstI32}, noAttrs);
87
87
88
88
// Test build method with no result types and supplied attributes.
89
- op = builder.create <OpTy>(loc, ValueRange{cstI32, cstI32}, attrs);
90
- verifyOp (std::move (op), {i32Ty}, {cstI32, cstI32}, attrs);
89
+ op = builder.create <OpTy>(loc, ValueRange{* cstI32, * cstI32}, attrs);
90
+ verifyOp (std::move (op), {i32Ty}, {* cstI32, * cstI32}, attrs);
91
91
}
92
92
93
93
protected:
@@ -96,8 +96,8 @@ class OpBuildGenTest : public ::testing::Test {
96
96
Location loc;
97
97
Type i32Ty;
98
98
Type f32Ty;
99
- test::TableGenConstant cstI32;
100
- test::TableGenConstant cstF32;
99
+ OwningOpRef< test::TableGenConstant> cstI32;
100
+ OwningOpRef< test::TableGenConstant> cstF32;
101
101
102
102
ArrayRef<NamedAttribute> noAttrs;
103
103
std::vector<NamedAttribute> attrStorage;
@@ -107,22 +107,22 @@ class OpBuildGenTest : public ::testing::Test {
107
107
// / Test basic build methods.
108
108
TEST_F (OpBuildGenTest, BasicBuildMethods) {
109
109
// Test separate args, separate results build method.
110
- auto op = builder.create <test::TableGenBuildOp0>(loc, i32Ty, cstI32);
111
- verifyOp (op, {i32Ty}, {cstI32}, noAttrs);
110
+ auto op = builder.create <test::TableGenBuildOp0>(loc, i32Ty, * cstI32);
111
+ verifyOp (op, {i32Ty}, {* cstI32}, noAttrs);
112
112
113
113
// Test separate args, collective results build method.
114
- op = builder.create <test::TableGenBuildOp0>(loc, TypeRange{i32Ty}, cstI32);
115
- verifyOp (op, {i32Ty}, {cstI32}, noAttrs);
114
+ op = builder.create <test::TableGenBuildOp0>(loc, TypeRange{i32Ty}, * cstI32);
115
+ verifyOp (op, {i32Ty}, {* cstI32}, noAttrs);
116
116
117
117
// Test collective args, collective params build method.
118
118
op = builder.create <test::TableGenBuildOp0>(loc, TypeRange{i32Ty},
119
- ValueRange{cstI32});
120
- verifyOp (op, {i32Ty}, {cstI32}, noAttrs);
119
+ ValueRange{* cstI32});
120
+ verifyOp (op, {i32Ty}, {* cstI32}, noAttrs);
121
121
122
122
// Test collective args, collective results, non-empty attributes
123
123
op = builder.create <test::TableGenBuildOp0>(loc, TypeRange{i32Ty},
124
- ValueRange{cstI32}, attrs);
125
- verifyOp (op, {i32Ty}, {cstI32}, attrs);
124
+ ValueRange{* cstI32}, attrs);
125
+ verifyOp (op, {i32Ty}, {* cstI32}, attrs);
126
126
}
127
127
128
128
// / The following 3 tests exercise build methods generated for operations
@@ -139,49 +139,49 @@ TEST_F(OpBuildGenTest, BasicBuildMethods) {
139
139
TEST_F (OpBuildGenTest, BuildMethodsSingleVariadicArgAndResult) {
140
140
// Test collective args, collective results method, building a unary op.
141
141
auto op = builder.create <test::TableGenBuildOp1>(loc, TypeRange{i32Ty},
142
- ValueRange{cstI32});
143
- verifyOp (std::move (op), {i32Ty}, {cstI32}, noAttrs);
142
+ ValueRange{* cstI32});
143
+ verifyOp (std::move (op), {i32Ty}, {* cstI32}, noAttrs);
144
144
145
145
// Test collective args, collective results method, building a unary op with
146
146
// named attributes.
147
147
op = builder.create <test::TableGenBuildOp1>(loc, TypeRange{i32Ty},
148
- ValueRange{cstI32}, attrs);
149
- verifyOp (std::move (op), {i32Ty}, {cstI32}, attrs);
148
+ ValueRange{* cstI32}, attrs);
149
+ verifyOp (std::move (op), {i32Ty}, {* cstI32}, attrs);
150
150
151
151
// Test collective args, collective results method, building a binary op.
152
152
op = builder.create <test::TableGenBuildOp1>(loc, TypeRange{i32Ty, f32Ty},
153
- ValueRange{cstI32, cstF32});
154
- verifyOp (std::move (op), {i32Ty, f32Ty}, {cstI32, cstF32}, noAttrs);
153
+ ValueRange{* cstI32, * cstF32});
154
+ verifyOp (std::move (op), {i32Ty, f32Ty}, {* cstI32, * cstF32}, noAttrs);
155
155
156
156
// Test collective args, collective results method, building a binary op with
157
157
// named attributes.
158
158
op = builder.create <test::TableGenBuildOp1>(
159
- loc, TypeRange{i32Ty, f32Ty}, ValueRange{cstI32, cstF32}, attrs);
160
- verifyOp (std::move (op), {i32Ty, f32Ty}, {cstI32, cstF32}, attrs);
159
+ loc, TypeRange{i32Ty, f32Ty}, ValueRange{* cstI32, * cstF32}, attrs);
160
+ verifyOp (std::move (op), {i32Ty, f32Ty}, {* cstI32, * cstF32}, attrs);
161
161
}
162
162
163
163
// / Test build methods for an Op with a single varadic arg and a non-variadic
164
164
// / result.
165
165
TEST_F (OpBuildGenTest, BuildMethodsSingleVariadicArgNonVariadicResults) {
166
166
// Test separate arg, separate param build method.
167
167
auto op =
168
- builder.create <test::TableGenBuildOp1>(loc, i32Ty, ValueRange{cstI32});
169
- verifyOp (std::move (op), {i32Ty}, {cstI32}, noAttrs);
168
+ builder.create <test::TableGenBuildOp1>(loc, i32Ty, ValueRange{* cstI32});
169
+ verifyOp (std::move (op), {i32Ty}, {* cstI32}, noAttrs);
170
170
171
171
// Test collective params build method, no attributes.
172
172
op = builder.create <test::TableGenBuildOp1>(loc, TypeRange{i32Ty},
173
- ValueRange{cstI32});
174
- verifyOp (std::move (op), {i32Ty}, {cstI32}, noAttrs);
173
+ ValueRange{* cstI32});
174
+ verifyOp (std::move (op), {i32Ty}, {* cstI32}, noAttrs);
175
175
176
176
// Test collective params build method no attributes, 2 inputs.
177
177
op = builder.create <test::TableGenBuildOp1>(loc, TypeRange{i32Ty},
178
- ValueRange{cstI32, cstF32});
179
- verifyOp (std::move (op), {i32Ty}, {cstI32, cstF32}, noAttrs);
178
+ ValueRange{* cstI32, * cstF32});
179
+ verifyOp (std::move (op), {i32Ty}, {* cstI32, * cstF32}, noAttrs);
180
180
181
181
// Test collective params build method, non-empty attributes.
182
182
op = builder.create <test::TableGenBuildOp1>(
183
- loc, TypeRange{i32Ty}, ValueRange{cstI32, cstF32}, attrs);
184
- verifyOp (std::move (op), {i32Ty}, {cstI32, cstF32}, attrs);
183
+ loc, TypeRange{i32Ty}, ValueRange{* cstI32, * cstF32}, attrs);
184
+ verifyOp (std::move (op), {i32Ty}, {* cstI32, * cstF32}, attrs);
185
185
}
186
186
187
187
// / Test build methods for an Op with a single varadic arg and multiple variadic
@@ -190,18 +190,18 @@ TEST_F(OpBuildGenTest,
190
190
BuildMethodsSingleVariadicArgAndMultipleVariadicResults) {
191
191
// Test separate arg, separate param build method.
192
192
auto op = builder.create <test::TableGenBuildOp3>(
193
- loc, TypeRange{i32Ty}, TypeRange{f32Ty}, ValueRange{cstI32});
194
- verifyOp (std::move (op), {i32Ty, f32Ty}, {cstI32}, noAttrs);
193
+ loc, TypeRange{i32Ty}, TypeRange{f32Ty}, ValueRange{* cstI32});
194
+ verifyOp (std::move (op), {i32Ty, f32Ty}, {* cstI32}, noAttrs);
195
195
196
196
// Test collective params build method, no attributes.
197
197
op = builder.create <test::TableGenBuildOp3>(loc, TypeRange{i32Ty, f32Ty},
198
- ValueRange{cstI32});
199
- verifyOp (std::move (op), {i32Ty, f32Ty}, {cstI32}, noAttrs);
198
+ ValueRange{* cstI32});
199
+ verifyOp (std::move (op), {i32Ty, f32Ty}, {* cstI32}, noAttrs);
200
200
201
201
// Test collective params build method, with attributes.
202
202
op = builder.create <test::TableGenBuildOp3>(loc, TypeRange{i32Ty, f32Ty},
203
- ValueRange{cstI32}, attrs);
204
- verifyOp (std::move (op), {i32Ty, f32Ty}, {cstI32}, attrs);
203
+ ValueRange{* cstI32}, attrs);
204
+ verifyOp (std::move (op), {i32Ty, f32Ty}, {* cstI32}, attrs);
205
205
}
206
206
207
207
// The next 2 tests test supression of ambiguous build methods for ops that
0 commit comments