From 77884c967d1cbc48afcbaef7e5a35adcb3c5da1b Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sat, 8 Aug 2026 04:14:34 +0800 Subject: [CodeGen] Implement machine SSA exit --- backend/lib/CodeGen/TargetDescription.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'backend/lib/CodeGen/TargetDescription.cpp') diff --git a/backend/lib/CodeGen/TargetDescription.cpp b/backend/lib/CodeGen/TargetDescription.cpp index e2bbe8a..e8c7d79 100644 --- a/backend/lib/CodeGen/TargetDescription.cpp +++ b/backend/lib/CodeGen/TargetDescription.cpp @@ -58,7 +58,13 @@ Expected TargetDescription::create(InstructionSet Instruction for (const InstructionDescriptor &Instruction : Instructions.descriptors()) { for (const OperandDescriptor &Operand : Instruction.Operands) { - if ((Operand.AllowedTargetFlags & ~MIRText->serializableOperandFlagMask()) != 0) { + if (Operand.AllowAnyTargetFlags && Operand.AllowedTargetFlags != 0) { + return makeUnexpected( + ErrorCode::InvalidArgument, + "instruction operand cannot combine unrestricted and explicit target flags"); + } + if (!Operand.AllowAnyTargetFlags && + (Operand.AllowedTargetFlags & ~MIRText->serializableOperandFlagMask()) != 0) { return makeUnexpected( ErrorCode::InvalidArgument, "instruction operand allows a target flag outside the MIR text schema"); -- cgit v1.2.3