@@ -103,13 +103,13 @@ template <> LogicalResult verifyBlockArgs(GenericOp op, Block &block) {
103103 auto nViews = op.getNumInputsAndOutputs ();
104104 auto nInputViews = op.getNumInputs ();
105105 if (block.getNumArguments () != nViews)
106- return op.emitError (
107- " op expected number of block arguments to match number of views" );
106+ return op.emitOpError (
107+ " expected number of block arguments to match number of views" );
108108
109109 for (unsigned i = 0 ; i < nViews; ++i) {
110110 auto viewType = op.getViewType (i);
111111 if (viewType.getElementType () != block.getArgument (i)->getType ())
112- return op.emitError ( " op expected block argument " )
112+ return op.emitOpError ( " expected block argument " )
113113 << i << " of the same type as elemental type of "
114114 << ((i < nInputViews) ? " input " : " output " )
115115 << " view: " << viewType;
@@ -122,13 +122,13 @@ template <> LogicalResult verifyBlockArgs(IndexedGenericOp op, Block &block) {
122122 auto nLoops = op.getNumLoops ();
123123 auto nViews = op.getNumInputsAndOutputs ();
124124 if (block.getNumArguments () != nViews + nLoops)
125- return op.emitError (
126- " op expected number of block arguments to match number of views + "
125+ return op.emitOpError (
126+ " expected number of block arguments to match number of views + "
127127 " number of loops" );
128128
129129 for (unsigned i = 0 ; i < nLoops; ++i) {
130130 if (!block.getArgument (i)->getType ().isIndex ())
131- return op.emitError ( " op expected block argument " )
131+ return op.emitOpError ( " expected block argument " )
132132 << i << " to be of IndexType" ;
133133 }
134134
@@ -137,7 +137,7 @@ template <> LogicalResult verifyBlockArgs(IndexedGenericOp op, Block &block) {
137137 auto viewType = op.getViewType (i);
138138 if (viewType.getElementType () !=
139139 block.getArgument (memrefArgIndex)->getType ())
140- return op.emitError ( " op expected block argument " )
140+ return op.emitOpError ( " expected block argument " )
141141 << memrefArgIndex << " of the same type as elemental type of "
142142 << ((i < nInputViews) ? " input " : " output " )
143143 << " view: " << viewType;
@@ -152,24 +152,24 @@ template <> LogicalResult verifyFuncArgs(GenericOp op, FunctionType funType) {
152152 auto nViews = op.getNumInputsAndOutputs ();
153153 auto nInputViews = op.getNumInputs ();
154154 if (funType.getNumInputs () != nViews)
155- return op.emitError ( " op expected fun arguments to match number of views" );
155+ return op.emitOpError ( " expected fun arguments to match number of views" );
156156 if (funType.getNumResults () != op.getNumOutputs ())
157- return op.emitError (
158- " op expected fun results to match number of output views" );
157+ return op.emitOpError (
158+ " expected fun results to match number of output views" );
159159
160160 for (auto en : llvm::enumerate (op.indexing_maps ())) {
161161 auto idx = en.index ();
162162 auto view = (idx < nInputViews) ? op.getInputViewType (idx)
163163 : op.getOutputViewType (idx - nInputViews);
164164 if (funType.getInput (idx) != view.getElementType ())
165- return op.emitError ( " op expected fun argument " )
165+ return op.emitOpError ( " expected fun argument " )
166166 << idx << " of the same type as elemental type "
167167 << view.getElementType () << " of view " << idx;
168168
169169 if (idx >= nInputViews) {
170170 auto resultIdx = idx - nInputViews;
171171 if (funType.getResult (resultIdx) != view.getElementType ())
172- return op.emitError ( " op expected fun result " )
172+ return op.emitOpError ( " expected fun result " )
173173 << resultIdx << " of the same type as elemental type "
174174 << view.getElementType () << " of view " << idx;
175175 }
@@ -184,14 +184,14 @@ LogicalResult verifyFuncArgs(IndexedGenericOp op, FunctionType funType) {
184184 auto nOutputs = op.getNumOutputs ();
185185 auto nViews = op.getNumInputsAndOutputs ();
186186 if (funType.getNumInputs () != nViews + nLoops)
187- return op.emitError (
188- " op expected fun arguments to match number of views + number of loops" );
187+ return op.emitOpError (
188+ " expected fun arguments to match number of views + number of loops" );
189189 if (funType.getNumResults () != nOutputs)
190- return op.emitError (
191- " op expected fun results to match number of output views" );
190+ return op.emitOpError (
191+ " expected fun results to match number of output views" );
192192 for (unsigned i = 0 ; i < nLoops; ++i) {
193193 if (!funType.getInput (i).isIndex ())
194- return op.emitError ( " op expected fun argument " )
194+ return op.emitOpError ( " expected fun argument " )
195195 << i << " to be of IndexType" ;
196196 }
197197 for (auto en : llvm::enumerate (op.indexing_maps ())) {
@@ -200,14 +200,14 @@ LogicalResult verifyFuncArgs(IndexedGenericOp op, FunctionType funType) {
200200 auto view = (idx < nInputViews) ? op.getInputViewType (idx)
201201 : op.getOutputViewType (idx - nInputViews);
202202 if (funType.getInput (funIdx) != view.getElementType ())
203- return op.emitError ( " op expected fun argument " )
203+ return op.emitOpError ( " expected fun argument " )
204204 << funIdx << " of the same type as elemental type "
205205 << view.getElementType () << " of view " << idx;
206206
207207 if (idx >= nInputViews) {
208208 auto resultIdx = idx - nInputViews;
209209 if (funType.getResult (resultIdx) != view.getElementType ())
210- return op.emitError ( " op expected fun result " )
210+ return op.emitOpError ( " expected fun result " )
211211 << resultIdx << " of the same type as elemental type "
212212 << view.getElementType () << " of view " << idx;
213213 }
@@ -221,20 +221,20 @@ LogicalResult verifyGenericOp(GenericOpType op) {
221221 auto nLoops = op.getNumLoops ();
222222 auto nViews = op.getNumInputsAndOutputs ();
223223 if (nViews != llvm::size (op.views ()))
224- return op.emitError ( " op expected exactly " ) << nViews << " view operands" ;
224+ return op.emitOpError ( " expected exactly " ) << nViews << " view operands" ;
225225
226226 auto ®ion = op.region ();
227227 auto funOp = op.getFunction ();
228228 auto funType = funOp ? funOp.getType () : FunctionType ();
229229 if (!region.empty ()) {
230230 if (region.getBlocks ().size () != 1 )
231- return op.emitError ( " op expected region with 1 block" );
231+ return op.emitOpError ( " expected region with 1 block" );
232232 if (failed (verifyBlockArgs (op, region.getBlocks ().front ())))
233233 return failure ();
234234 } else {
235235 if (!funOp || !funOp.getType ())
236- return op.emitError (
237- " op expected fun attribute to refer to a defined symbol" );
236+ return op.emitOpError (
237+ " expected fun attribute to refer to a defined symbol" );
238238 if (failed (verifyFuncArgs (op, funType)))
239239 return failure ();
240240 }
@@ -249,31 +249,31 @@ LogicalResult verifyGenericOp(GenericOpType op) {
249249 : op.getOutputViewType (idx - nInputViews);
250250
251251 if (m.getNumSymbols () != 0 )
252- return op.emitError ( " op expected indexing_map #" )
252+ return op.emitOpError ( " expected indexing_map #" )
253253 << idx << " to have no symbols" ;
254254
255255 if (m.getNumDims () != nLoops)
256- return op.emitError ( " op expected indexing_map #" )
256+ return op.emitOpError ( " expected indexing_map #" )
257257 << idx << " to have " << nLoops
258258 << " dim(s) to match the number of loops" ;
259259
260260 if (m.getNumResults () == 1 && view.getRank () == 0 ) {
261261 auto cst = m.getResult (0 ).template dyn_cast <AffineConstantExpr>();
262262 if (!cst || cst.getValue () != 0 )
263- return op.emitError ( " op expected indexing_map #" )
263+ return op.emitOpError ( " expected indexing_map #" )
264264 << idx << " to be 0 to match 0-D view: " << view;
265265 }
266266
267267 if (m.getNumResults () != view.getRank ())
268- return op.emitError ( " op expected indexing_map #" )
268+ return op.emitOpError ( " expected indexing_map #" )
269269 << idx << " results to match view rank: " << view;
270270 }
271271
272272 auto concatMap = concatAffineMaps (indexingMaps);
273273 auto aggregateMap = inversePermutation (concatMap);
274274 if (!aggregateMap)
275- return op.emitError ( " op expected the concatenation of maps in indexing_map "
276- " to be invertible" );
275+ return op.emitOpError ( " expected the concatenation of maps in indexing_map "
276+ " to be invertible" );
277277
278278 return success ();
279279}
@@ -471,7 +471,7 @@ LogicalResult verifyYield(YieldOp op, GenericOpType genericOp) {
471471 for (unsigned i = 0 ; i != nOutputViews; ++i) {
472472 auto elementType = genericOp.getOutputViewType (i).getElementType ();
473473 if (op.getOperand (i)->getType () != elementType)
474- return op.emitError (" type of return operand " )
474+ return op.emitOpError (" type of return operand " )
475475 << i << " (" << op.getOperand (i)->getType ()
476476 << " ) doesn't match view element type (" << elementType << " )" ;
477477 }
0 commit comments