diff --git a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp --- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp +++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp @@ -1506,7 +1506,7 @@ getLexer().Lex(); if (getLexer().is(AsmToken::EndOfStatement)) break; - if (!getLexer().is(AsmToken::Comma)) + if (getLexer().isNot(AsmToken::Comma)) goto MatchFail; AsmToken Comma = getLexer().getTok(); VTypeIElements.push_back(Comma); @@ -1571,7 +1571,7 @@ // If NoMatch, unlex all the tokens that comprise a vtypei operand MatchFail: - while (VTypeIElements.size() > 0) + while (!VTypeIElements.empty()) getLexer().UnLex(VTypeIElements.pop_back_val()); return MatchOperand_NoMatch; }