From 6580ac1c05bd1cbccd2dcd71fd9c2a384ae3db56 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Mon, 3 Aug 2026 18:31:58 +0800 Subject: [CodeGen] Model complete MIR operands --- backend/lib/CodeGen/TargetDescription.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'backend/lib/CodeGen/TargetDescription.cpp') diff --git a/backend/lib/CodeGen/TargetDescription.cpp b/backend/lib/CodeGen/TargetDescription.cpp index 3a6ea31..a32534d 100644 --- a/backend/lib/CodeGen/TargetDescription.cpp +++ b/backend/lib/CodeGen/TargetDescription.cpp @@ -203,6 +203,13 @@ Expected TargetDescription::validateTargetOperand(const OperandDescriptor } return Registers.validateRegisterMask(*Mask->Mask); } + if (const auto *Mask = Operand.getIf(); Mask != nullptr) { + if (!Mask->Mask) { + return makeUnexpected(ErrorCode::VerificationError, + "live-out register-mask operand contains a null mask"); + } + return Registers.validateRegisterMask(*Mask->Mask); + } const Register *Reg = Operand.getIf(); if (Reg == nullptr) -- cgit v1.2.3