File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -437,14 +437,14 @@ LogicalResult cir::VTableAttr::verify(
437437 if (sTy .getMembers ().empty () || vtableData.empty ())
438438 return emitError () << " expected record type with one or more subtype" ;
439439
440- for (size_t i = 0 ; i < sTy .getMembers ().size (); ++i) {
441- auto constArrayAttr = mlir::dyn_cast<cir::ConstArrayAttr>(vtableData[i]);
440+ if (cir::ConstRecordAttr::verify (emitError, type, vtableData).failed ())
441+ return failure ();
442+
443+ for (const auto &data : vtableData.getAsRange <mlir::Attribute>()) {
444+ const auto &constArrayAttr = mlir::dyn_cast<cir::ConstArrayAttr>(data);
442445 if (!constArrayAttr)
443446 return emitError () << " expected constant array subtype" ;
444447
445- if (cir::ConstRecordAttr::verify (emitError, type, vtableData).failed ())
446- return failure ();
447-
448448 LogicalResult eltTypeCheck = success ();
449449 auto arrayElts = mlir::cast<ArrayAttr>(constArrayAttr.getElts ());
450450 arrayElts.walkImmediateSubElements (
You can’t perform that action at this time.
0 commit comments