<div dir="ltr">It will probably be hard to find all the cases.  Unfortunately clang-tidy doesn't have a "detect deep indentation" check, but that would be pretty useful, so maybe I'll try to add that at some point (although I doubt I can get to it before the big reformat).<div><br></div><div>Finding all of the egregious cases before the big reformat will present a challenge, so I'm not sure if it's better to spend effort trying, or just deal with it as we spot code that looks bad because of indentation level.</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Aug 27, 2016 at 9:24 AM Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Aug 26, 2016, at 6:12 PM, Zachary Turner via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:</div><br class="m_-6899933430770945279Apple-interchange-newline"><div><div dir="ltr">Back to the formatting issue, there's a lot of code that's going to look bad after the reformat, because we have some DEEPLY indented code.  LLVM has adopted the early return model for this reason.  A huge amount of our deeply nested code could be solved by using early returns.  </div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>FWIW, early returns are part of the LLVM Coding standard:</div><div><a href="http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code" target="_blank">http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code</a></div><div><br></div><div>So it makes sense for LLDB to adopt this approach at some point.</div><div><br></div><div>I don’t have an opinion about whether it happens before or after the "big reformat", but I guess I agree with your point that doing it would be good to do it for the most egregious cases before the reformat.</div></div></div><div style="word-wrap:break-word"><div><div><br></div><div>-Chris</div></div></div></blockquote></div>