@@ -144,13 +144,11 @@ LogicalResult spirv::GraphARMOp::verifyBody() {
144144
145145 ValueTypeRange<OperandRange> graphOutputOperandTypes =
146146 op.getValue ().getType ();
147- for (unsigned i = 0 , size = graphOutputOperandTypes.size (); i < size; ++i) {
148- Type graphOutputOperandType = graphOutputOperandTypes[i];
149- Type grResultType = grType.getResult (i);
150- if (graphOutputOperandType != grResultType)
147+ for (const auto [index, type] : llvm::enumerate (graphOutputOperandTypes)) {
148+ if (type != grType.getResult (index))
151149 return op.emitError (" type of return operand " )
152- << i << " (" << graphOutputOperandType
153- << " ) doesn't match graph result type ( " << grResultType << " )" ;
150+ << index << " (" << type << " ) doesn't match graph result type ( "
151+ << grType. getResult (index) << " )" ;
154152 }
155153 return WalkResult::advance ();
156154 });
@@ -196,12 +194,12 @@ LogicalResult spirv::GraphOutputsARMOp::verify() {
196194 << getNumOperands () << " operands, but enclosing spirv.ARM.Graph (@"
197195 << graph.getName () << " ) returns " << results.size ();
198196
199- for (const auto &result : llvm::enumerate (results))
200- if (getOperand (result. index ()) .getType () != result. value () )
201- return emitError () << " type of return operand " << result. index () << " ("
202- << getOperand (result. index () ).getType ()
197+ for (const auto &[index, result] : llvm::enumerate (results))
198+ if (getOperand (index) .getType () != result)
199+ return emitError () << " type of return operand " << index << " ("
200+ << getOperand (index).getType ()
203201 << " ) doesn't match spirv.ARM.Graph result type ("
204- << result. value () << " )"
202+ << result << " )"
205203 << " in graph @" << graph.getName ();
206204 return success ();
207205}
0 commit comments