<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 6/15/20 6:25 PM, Chris Lattner via
llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:11B86BE6-4142-411F-918A-66B9E60B8906@nondot.org">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jun 15, 2020, at 4:13 PM, River Riddle via
llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org"
class="" moz-do-not-send="true">llvm-dev@lists.llvm.org</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class=""><br class="">
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Jun 15, 2020
at 4:08 PM David Blaikie via llvm-dev <<a
href="mailto:llvm-dev@lists.llvm.org" class=""
moz-do-not-send="true">llvm-dev@lists.llvm.org</a>>
wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">On Mon, Jun 15,
2020 at 4:05 PM Mehdi AMINI via llvm-dev<br class="">
<<a href="mailto:llvm-dev@lists.llvm.org"
target="_blank" class="" moz-do-not-send="true">llvm-dev@lists.llvm.org</a>>
wrote:<br class="">
><br class="">
> As another data point, the MLIR part of the
codebase is pretty consistent on this: never use
braces for trivial (single statement) if/else/for, but
always put it on every branch if needed on any side of
the if/else.<br class="">
<br class="">
Any opinion/stance policy/practice on the "one line,
or one statement<br class="">
(& possibly comments, etc)" issue?<br class="">
</blockquote>
<div class=""><br class="">
</div>
<div class="">Generally, any time there is a comment
within the body I don't really see it as "trivial"
anymore.</div>
<div class=""><br class="">
</div>
<div class="">Prefer:</div>
<div class=""> if (...) {</div>
<div class=""> // Some comment.</div>
<div class=""> single statement;</div>
<div class=""> }</div>
<div class=""> // Some comment.</div>
<div class=""> If (...)</div>
<div class=""> single statement;</div>
<div class=""><br class="">
</div>
<div class="">Over:</div>
<div class=""> if (...)</div>
<div class=""> // Some comment</div>
<div class=""> single statement;</div>
</div>
</div>
</div>
</blockquote>
<br class="">
</div>
<div>+1</div>
<div><br class="">
</div>
<div>-Chris</div>
</blockquote>
<p>+1</p>
<p>Philip</p>
</body>
</html>