aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/TargetDescription.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backend/lib/CodeGen/TargetDescription.cpp')
-rw-r--r--backend/lib/CodeGen/TargetDescription.cpp8
1 files changed, 7 insertions, 1 deletions
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> 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");