- LLVM clang-format style doesn't allow one-line ifs.
- LLVM clang-tidy style says method names should start with a lowercase letter. But currently WebAssemblyAsmParser's parent class MCTargetAsmParser is mixing lowercase and uppercase method names itself so overridden methods cannot be renamed now.
- Changed else ifs after returns to ifs.
- Added some newlines for readability.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 25751 Build 25750: arc lint + arc unit
Event Timeline
lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp | ||
---|---|---|
447 | Adding a newline here before a closing brace seems strange. |
lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp | ||
---|---|---|
447 | Then in case code is structured like if (...) { ... else if (...) { ... } else if (...) { ... } ... And body of each if and else if is long enough so I'd like to add newlines, where should I add them? |
lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp | ||
---|---|---|
447 | For me that block structure it enough to break it up visually. To my eye adding newlines at the top of bottom of a block looks strange so I would leave it as is. In this particular case since we return at the end of each block you could remove the else's completely and make it into a sequence of "if (xxx) { return .. }", but I'm not sure that would help with read-ability in this case. |
lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp | ||
---|---|---|
447 | That sounds good. I changed them into ifs and added newlines after. LLVM coding standards say don't use else after a return anyway. |
Adding a newline here before a closing brace seems strange.