[PATCH] D63162: GlobalISel: Avoid producing Illegal copies in RegBankSelect

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 12:43:54 PDT 2019


qcolombet added inline comments.


================
Comment at: lib/CodeGen/GlobalISel/RegisterBankInfo.cpp:252
     return getInvalidInstructionMapping();
+  }
 
----------------
arsenm wrote:
> qcolombet wrote:
> > From LLVM standard: no brackets here.
> I will die on the hill that there should be braces here. There are multiple lines after the if due to the comment. I don't see where it says this, and clang-format doesn't touch it
I don't see anything in the standard mentioning the one-line-block thing now that you mention it. Which is strange because then it would be left to interpretation for case like:
```
if ()
  continue;
```
or
```
if () {
  continue;
}
```
whereas I thought we were very strict at using the former.

FWIW, clang will not remove the braces for the latter case either, so that's not a good indication of what is in the standard, unless the standard is: we don't care :).

Anyway, I don't really care, but I apply the rule for every one-statement-block. To me comments don't count as lines.

For instance, `lib/Analysis/LazyCallGraph.cpp` has one-statement block with comments (i.e., more than one line block in the end), but it still doesn't have braces.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63162/new/

https://reviews.llvm.org/D63162





More information about the llvm-commits mailing list