Skip to content

Commit 6a2bff5

Browse files
committed
Update validateMemOp
1 parent 42fbf34 commit 6a2bff5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,14 +1260,13 @@ static std::string PPCMnemonicSpellCheck(StringRef S, const FeatureBitset &FBS,
12601260
unsigned VariantID = 0);
12611261

12621262
// Check that the register+immediate memory operand is in the right position and
1263-
// is expected by the instruction
1263+
// is expected by the instruction. Returns true if the memory operand syntax is
1264+
// valid; otherwise, returns false.
12641265
static bool validateMemOp(const OperandVector &Operands, bool isMemriOp) {
12651266
for (size_t idx = 0; idx < Operands.size(); ++idx) {
12661267
const PPCOperand &Op = static_cast<const PPCOperand &>(*Operands[idx]);
1267-
if ((idx == 3 && Op.isMemOpBase() != isMemriOp) ||
1268-
(idx != 3 && Op.isMemOpBase())) {
1269-
return false;
1270-
}
1268+
if (Op.isMemOpBase() != (idx == 3 && isMemriOp))
1269+
return false;
12711270
}
12721271
return true;
12731272
}

0 commit comments

Comments
 (0)