================ @@ -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) { ---------------- xlauko wrote:
Maybe it is completely redundant check as `cir::ConstRecordAttr::verify` checks this? 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