[LLVMdev] LLVM 2.9 metadata
Seb
babslachem at gmail.com
Thu Dec 15 02:32:41 PST 2011
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
<http://www.llvm.org/releases/2.9/docs/SourceLevelDebugging.html#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
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111215/96260573/attachment.html>
More information about the llvm-dev
mailing list