Hi Devang,<br><br>Not only "vtable ptr" is a problem, for this field it seems that CLANG emits a NULL metadata node which is translated into 'i32 0'. The other problem is for 'isArtificial' field with is described as being of type i1 and CLANG emits i32. Looking at sources, it seems that it should be a i32 flag field.<br>
<br>Hope this helps,<br>Best Regards<br>Seb<br><br><br><br><div class="gmail_quote">2011/12/15 Devang Patel <span dir="ltr"><<a href="mailto:dpatel@apple.com">dpatel@apple.com</a>></span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word"><br><div><div class="im"><div>On Dec 15, 2011, at 2:32 AM, Seb wrote:</div><br><blockquote type="cite"><div>
<pre>Hi all,<br><br>In LLVM documentation about source level debugging (<a href="http://www.llvm.org/releases/2.9/docs/SourceLevelDebugging.html" target="_blank">http://www.llvm.org/releases/2.9/docs/SourceLevelDebugging.html</a>)<br>
<br>
Subprogram descriptor is defined as:<br><br>!2 = metadata !{<br> i32, ;; Tag = 46 + <a href="http://www.llvm.org/releases/2.9/docs/SourceLevelDebugging.html#LLVMDebugVersion" target="_blank">LLVMDebugVersion</a><br>
;; (DW_TAG_subprogram)<br>
i32, ;; Unused field.<br> metadata, ;; Reference to context descriptor<br> metadata, ;; Name<br> metadata, ;; Display name (fully qualified C++ name)<br> metadata, ;; MIPS linkage name (for C++)<br> metadata, ;; Reference to file where defined<br>
i32, ;; Line number where defined<br> metadata, ;; Reference to type descriptor<br> i1, ;; True if the global is local to compile unit (static)<br> i1 ;; True if the global is defined in the compile unit (not extern)<br>
i32 ;; Virtuality, e.g. dwarf::DW_VIRTUALITY__virtual<br> i32 ;; Index into a virtual function<br> metadata, ;; indicates which base type contains the vtable pointer for the <br> ;; derived class</pre>
</div></blockquote><div><br></div></div>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. </div><div>Thanks!</div><div>-</div><div>Devang</div>
<div><br><blockquote type="cite"><div class="im"><div><pre> i1 ;; isArtificial<br> i1 ;; isOptimized<br> Function *;; Pointer to LLVM function<br><br>}<br><br>When I use clang 2.9 and emit-llvm code metadata generated for a routine foo is:<br>
<br>!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 ]<br>
!1 = metadata !{i32 589865, metadata !"foodbg.c", metadata !"/home/deldon/tmp", metadata !2} ; [ DW_TAG_file_type ]<br>!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 ]<br>
!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 ]<br>!4 = metadata !{null}<br>...<br><br>As you can see metadata definition !0 doesn't match documentation. What is the correct definition (CLANG or LLVM documentation ?).<br>
Thanks for your answer<br>Seb<br><br><br><br></pre>
</div></div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div>
</blockquote></div><br>