[PATCH] D140777: [AVR] Fix some ambiguous cases in AsmParser
Ben Shi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 1 17:55:52 PST 2023
benshi001 added inline comments.
================
Comment at: llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp:629-630
while (getLexer().isNot(AsmToken::EndOfStatement)) {
- if (!first)
+ if (OperandNum++ > 0)
eatComma();
----------------
aykevl wrote:
> I think the following is a lot easier to read:
>
> ```
> OperandNum++;
> if (OperandNum > 1)
> eatComma();
> ```
>
> If you want OperandNum to start at 0, I suggest initializing it to -1:
>
> ```
> int OperandNum = -1;
> ```
Thanks. Using `int OperandNum = -1;` looks more clear.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140777/new/
https://reviews.llvm.org/D140777
More information about the llvm-commits
mailing list