[LLVMdev] [PROPOSAL] Attach debugging information with LLVM instruction

Eric Christopher echristo at apple.com
Thu Sep 10 13:33:01 PDT 2009


On Sep 10, 2009, at 10:48 AM, Devang Patel wrote:

> The proposed solution is to optionally attach debug information with
> llvm instruction directly. A new keyword 'dbg' is used to identify
> debugging information associated with an instruction. The debugging
> information, if available, is printed after the last instruction
> operand. The debugging information entry uses MDNode and it is not
> counted as an instruction operand. For example,
>
> !1 = metadata !{i32 458769, i32 0, i32 12, metadata !"foo.c", metadata
> !"/tmp", metadata !"clang 1.0", i1 true, i1 false, metadata !"", i32
> 0}
> !7 = metadata !{i32 5, i32 5, metadata !1, metadata !1}
> !8 = metadata !{i32 6, i32 5, metadata !1, metadata !1}
>
>  ...
>  store i32 42, i32* %i, dbg metadata !7
>  store i32 1, i32* %j.addr, dbg metadata !8
>  br label %if.end, dbg metadata !8
>  ...

So, if we later wanted to attach some other metadata to an instruction  
it would look something like:

store i32 42, i32* %i, dbg metadata !7, spork !15

or some such? And when you attach the metadata to the instruction how  
do you plan on making it evident as debug as opposed to spork?

-eric



More information about the llvm-dev mailing list