This patch adds the AVRAsmParser library.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/AVR/AsmParser/AVRAsmParser.cpp | ||
---|---|---|
10 ↗ | (On Diff #56494) | It's not clear why this line is here, I couldn't see any use of std::stringstream, std::stringbuf, etc.? |
45 ↗ | (On Diff #56494) | I don't see this being generated. I think you're missing the -gen-asm-matcher line from your CMakeLists.txt. Likewise, I think you're missing the has_asmparser = 1 part of LLVMBuild.txt |
251 ↗ | (On Diff #56494) | You might want to make these two generated by TableGen comments consistent. |
403 ↗ | (On Diff #56494) | It's not clear why you're starting a block here? |
lib/Target/AVR/AsmParser/AVRAsmParser.cpp | ||
---|---|---|
30 ↗ | (On Diff #69477) | Local includes usually go first and are sorted alphabetically, if there are no reasons against it. |
449 ↗ | (On Diff #69477) | Avoid else after return. Also, the condition could be inverted and made into an early "return true". |
563 ↗ | (On Diff #69477) | Avoid else after continue. |
LGTM with one remaining inline comment.
lib/Target/AVR/AsmParser/AVRAsmParser.cpp | ||
---|---|---|
564 ↗ | (On Diff #72780) | 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. |
Reworked early returns after else
lib/Target/AVR/AsmParser/AVRAsmParser.cpp | ||
---|---|---|
564 ↗ | (On Diff #72780) | Have fixed that up now, thanks for the clarification :) |