[llvm-commits] [llvm] r133286 - in /llvm/trunk: include/llvm/MC/MCStreamer.h include/llvm/Target/TargetRegistry.h lib/CodeGen/LLVMTargetMachine.cpp lib/MC/MCAsmStreamer.cpp lib/Target/PTX/PTXMCAsmStreamer.cpp lib/Target/PTX/PTXTargetMachine.cpp tools/llvm-mc/llvm-mc.cpp

Bill Wendling isanbard at gmail.com
Fri Jun 17 13:55:14 PDT 2011


On Jun 17, 2011, at 1:45 PM, Chris Lattner wrote:

> On Jun 17, 2011, at 1:35 PM, Bill Wendling wrote:
> 
>> Author: void
>> Date: Fri Jun 17 15:35:21 2011
>> New Revision: 133286
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=133286&view=rev
>> Log:
>> Add an option that allows one to "decode" the LSDA.
>> 
>> The LSDA is a bit difficult for the non-initiated to read. Even with comments,
>> it's not always clear what's going on. This wraps the ASM streamer in a class
>> that retains the LSDA and then emits a human-readable description of what's
>> going on in it.
> 
> Spiffy.  Why is this a new set of flags?  Can't this just be tied to verbose asm?  I don't see any reason to have -decode-mc-lsda/-decode-lsda or to pass it down through the APIs as a bool.

I can do that. I did it this way to give people the option of not having it emitted when they don't want it. But having it default to "on" for -asm-verbose works for me too.

> Also, why is this implemented by subclassing MCAsmStreamer?  Can't the code generator just emit this as verbose asm comments instead of reconstructing it?


I actually do some of that now (see below). It's not the most readable thing in the world, but could be made a bit better. One major benefit of making it a subclass of MCAsmStreamer, however, is that you can run it on a .s file which doesn't have verbose comments in them. I would really like to maintain that ability.

-bw

        .byte   255                     ## @LPStart Encoding = omit
        .byte   155                     ## @TType Encoding = indirect pcrel sdata4
        .byte   220                     ## @TType base offset
        .space  1
        .byte   3                       ## Call site Encoding = udata4
        .byte   78                      ## Call site table length
Lset0 = Ltmp7-Leh_func_begin1           ## Region start
        .long   Lset0
Lset1 = Ltmp8-Ltmp7                     ## Region length
        .long   Lset1
Lset2 = Ltmp9-Leh_func_begin1           ## Landing pad
        .long   Lset2
        .byte   3                       ## Action
...
                                        ## -- Action Record Table --
                                        ## Action Record
        .byte   2                       ##   TypeInfo index
        .byte   0                       ##   Next action
                                        ## Action Record
        .byte   1                       ##   TypeInfo index
        .byte   125                     ##   Next action
                                        ## -- Catch TypeInfos --
        .long   __ZTIPKc at GOTPCREL+4     ## TypeInfo
        .long   __ZTIi at GOTPCREL+4       ## TypeInfo




More information about the llvm-commits mailing list