[PATCH] D20046: [AVR] Add assembly parser

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 05:29:41 PDT 2016


kparzysz accepted this revision.
kparzysz added a reviewer: kparzysz.
kparzysz added a comment.
This revision is now accepted and ready to land.

LGTM with one remaining inline comment.


================
Comment at: lib/Target/AVR/AsmParser/AVRAsmParser.cpp:564
@@ +563,3 @@
+
+      return Error(Loc, "failed to parse register and immediate pair");
+    } else if (MatchResult == MatchOperand_Success) {
----------------
The recommendation from the coding standards is to avoid "else" if the "then" part of an if statement cannot fall through into the following code.  So, if there is "if (...) { return; } else { ... }" then the else is not necessary because the else part can only execute is the condition was false regardless of whether the else is there or not. The same applies to continue/break/goto/etc.

Seeing that you switched the code around and indeed avoided else after continue, I realize that the intent of the comment wasn't clear.


https://reviews.llvm.org/D20046





More information about the llvm-commits mailing list