[PATCH] D24180: Emit 'no line' information for interesting 'orphan' instructions

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 13:40:28 PST 2016


Could be - if you wanted to submit an NFC change to refactor the existing
code to look more like this - for general readability and to make your
subsequent change more diff friendly, that might be an idea.

On Fri, Nov 11, 2016 at 11:31 AM Paul Robinson <paul.robinson at sony.com>
wrote:

> probinson added a comment.
>
> I was wondering if maybe I should restructure the DwarfDebug.cpp bit.
> Currently it's like
>
>   beginInstruction() {
>     if (!MI->isDebugValue()) {
>       if (DL != PrevInstLoc) {
>         if (DL) {
>           // case for a new, explicit location
>         } else if (somewhat complicated condition) {
>           // case for emitting line-0
>         }
>       } else if (DL) {
>         if (DL.getLine() != LastAsmLine) {
>           // case for restoring a previous line after emitting line-0
>         }
>       }
>     }
>   } // end of function
>
> and this could easily be redone as a sequence of much-less-indented cases:
>
>   beginInstruction() {
>     if (MI->isDebugValue())
>       return;
>     if (DL == PrevInstLoc) {
>       if (DL && DL.getLine() != LastAsmLine) {
>         // case for restoring a previous line after emitting line-0
>       }
>       return;
>     }
>     // DL != PrevInstLoc
>     if (DL) {
>       // case for a new, explicit location
>       return;
>     }
>     if (somewhat complicated condition) {
>       // case for emitting line-0
>     }
>   }
>
> Would that help?  The diff would be harder to read but the result might
> make more sense.
>
>
> https://reviews.llvm.org/D24180
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161121/2755ec1e/attachment.html>


More information about the llvm-commits mailing list