[LLVMdev] LLVM 2.9 metadata

Devang Patel dpatel at apple.com
Thu Dec 15 10:00:27 PST 2011


On Dec 15, 2011, at 2:32 AM, Seb wrote:

> Hi all,
> 
> In LLVM documentation about source level debugging (http://www.llvm.org/releases/2.9/docs/SourceLevelDebugging.html)
> 
> 
> Subprogram descriptor is defined as:
> 
> !2 = metadata !{
>   i32,      ;; Tag = 46 + LLVMDebugVersion
>             ;; (DW_TAG_subprogram)
> 
>   i32,      ;; Unused field.
>   metadata, ;; Reference to context descriptor
>   metadata, ;; Name
>   metadata, ;; Display name (fully qualified C++ name)
>   metadata, ;; MIPS linkage name (for C++)
>   metadata, ;; Reference to file where defined
> 
>   i32,      ;; Line number where defined
>   metadata, ;; Reference to type descriptor
>   i1,       ;; True if the global is local to compile unit (static)
>   i1        ;; True if the global is defined in the compile unit (not extern)
> 
>   i32       ;; Virtuality, e.g. dwarf::DW_VIRTUALITY__virtual
>   i32       ;; Index into a virtual function
>   metadata, ;; indicates which base type contains the vtable pointer for the 
>             ;; derived class

If you're wondering about this field then it is unused in 'c' style functions so it does not matter. I fixed it in r146665. 
Thanks!
-
Devang

>   i1        ;; isArtificial
>   i1        ;; isOptimized
>   Function *;; Pointer to LLVM function
> 
> }
> 
> When I use clang 2.9 and emit-llvm code metadata generated for a routine foo is:
> 
> !0 = metadata !{i32 589870, i32 0, metadata !1, metadata !"foo", metadata !"foo", metadata !"", metadata !1, i32 1, metadata !3, i1 false, i1 true, i32 0, i32 0, i32 0, i32 0, i1 false, void ()* @foo} ; [ DW_TAG_subprogram ]
> 
> !1 = metadata !{i32 589865, metadata !"foodbg.c", metadata !"/home/deldon/tmp", metadata !2} ; [ DW_TAG_file_type ]
> !2 = metadata !{i32 589841, i32 0, i32 12, metadata !"foodbg.c", metadata !"/home/deldon/tmp", metadata !"clang version 2.9 (tags/RELEASE_29/final)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
> 
> !3 = metadata !{i32 589845, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !4, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
> !4 = metadata !{null}
> ...
> 
> As you can see metadata definition !0 doesn't match documentation. What is the correct definition (CLANG or LLVM documentation ?).
> 
> Thanks for your answer
> Seb
> 
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111215/57a27485/attachment.html>


More information about the llvm-dev mailing list