================ @@ -424,6 +424,44 @@ cir::ConstVectorAttr::verify(function_ref<InFlightDiagnostic()> emitError, return elementTypeCheck; } +//===----------------------------------------------------------------------===// +// CIR VTableAttr +//===----------------------------------------------------------------------===// + +LogicalResult cir::VTableAttr::verify( + llvm::function_ref<mlir::InFlightDiagnostic()> emitError, mlir::Type type, + mlir::ArrayAttr vtableData) { + auto sTy = mlir::dyn_cast_if_present<cir::RecordType>(type); + if (!sTy) + return emitError() << "expected !cir.record type result"; + if (sTy.getMembers().empty() || vtableData.empty()) + return emitError() << "expected record type with one or more subtype"; + + for (size_t i = 0; i < sTy.getMembers().size(); ++i) { ---------------- Andres-Salamanca wrote:
Could we use a range based for loop here, or if we need the index, use `llvm::enumerate` instead? We’re currently just using i for indexing https://github.com/llvm/llvm-project/pull/154415 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits