Re: [lldb-dev] LLDB Evolution

2016-08-27 Thread Zachary Turner via lldb-dev
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).

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.

On Sat, Aug 27, 2016 at 9:24 AM Chris Lattner  wrote:

> On Aug 26, 2016, at 6:12 PM, Zachary Turner via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
>
> 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.
>
>
> FWIW, early returns are part of the LLVM Coding standard:
>
> http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
>
> So it makes sense for LLDB to adopt this approach at some point.
>
> 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.
>
> -Chris
>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] LLDB Evolution

2016-08-27 Thread Chris Lattner via lldb-dev

> On Aug 26, 2016, at 6:12 PM, Zachary Turner via lldb-dev 
>  wrote:
> 
> 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. 

FWIW, early returns are part of the LLVM Coding standard:
http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
 


So it makes sense for LLDB to adopt this approach at some point.

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.

-Chris___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev