[PATCH] D20046: [AVR] Add assembly parser

Dylan McKay via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 06:10:15 PDT 2016


dylanmckay added inline comments.

================
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) {
----------------
kparzysz wrote:
> 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.
Have fixed that up now, thanks for the clarification :)


https://reviews.llvm.org/D20046





More information about the llvm-commits mailing list