<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I think in the error output I sent, I noticed the issue seemed to happen on DIDerivedType metadata that have a "baseType". </div><div class=""><br class=""></div><div class="">-- </div><div class="">Mehdi</div><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 23, 2016, at 6:59 AM, Teresa Johnson <<a href="mailto:tejohnson@google.com" class="">tejohnson@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Both of these cases work fine. The types are in fact DICompositeType, and are reached via the DISubroutineType for the imported function. E.g. for your second example:<div class=""><br class=""></div><div class=""><div class="">struct foo { };</div><div class="">struct bar { };</div><div class="">void f(foo (*)(bar)) {</div><div class="">}</div></div><div class=""><br class=""></div><div class="">The original module looks like:</div><div class=""><br class=""></div><div class=""><div class="">!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !1, line: 1, size: 8, align: 8, flags: DIFlagFwdDecl, identifier: "_ZTS3foo")</div><div class="">!5 = !DICompositeType(tag: DW_TAG_structure_type, name: "bar", file: !1, line: 2, size: 8, align: 8, flags: DIFlagFwdDecl, identifier: "_ZTS3bar")</div></div><div class="">...</div><div class=""><div class="">!7 = distinct !DISubprogram(name: "f", linkageName: "_Z1fPF3foo3barE", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, variables: !13)</div><div class="">!8 = !DISubroutineType(types: !9)</div><div class="">!9 = !{null, !10}</div><div class="">!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64, align: 64)</div><div class="">!11 = !DISubroutineType(types: !12)</div><div class="">!12 = !{!"_ZTS3foo", !"_ZTS3bar"}</div></div><div class=""><br class=""></div><div class="">Because they are reached via the imported function's DISubprogram, they get imported properly.</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Feb 22, 2016 at 11:21 PM, David Blaikie <span dir="ltr" class=""><<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Yeah - I figured you would've caught it already if it were this simple. What sort of testing have you done?<br class=""><br class="">Happy to go through a few things with you in person tomorrow as well. Perhaps I'm just not understanding the algorithm you're implementing here.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Feb 22, 2016 at 9:09 PM, Teresa Johnson <span dir="ltr" class=""><<a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote"><span class="">On Mon, Feb 22, 2016 at 8:03 PM, David Blaikie <span dir="ltr" class=""><<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Have either of you tried creating a simple test case? Naively it looks like any use of a pointer-to-user-defined type would hit this in some way, no?<br class=""><br class="">import this function:<br class=""><br class="">struct foo { };<br class="">void bar(foo *f) { <br class="">}<br class=""><br class="">and I think the code will look at the type of 'f', getCompositeTypeToImport will immediately return null, because 'f' isn't a DICompositeType, and the type won't be retained.<br class=""><br class="">Note that the type could be worse, it could involve importing more than one type:<br class=""><br class="">struct foo { };<br class="">struct bar { };<br class="">void f(foo (*)(bar)) {<br class="">}<br class=""></div><div class="gmail_extra"><br class=""></div></blockquote><div class=""><br class=""></div></span><div class="">Hadn't tried that because I wasn't sure what to look for to be honest (especially since my testing is all fine at this point). Will give that a try to see how it behaves.</div><div class=""><div class=""><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote"><div class=""><div class="">On Mon, Feb 22, 2016 at 7:39 PM, Teresa Johnson via llvm-commits <span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span> wrote:<br class=""></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div class=""><div dir="ltr" class="">Unfortunately without seeing how the types were referenced in the original module I may not be able to deduce why they weren't pulled in. But go ahead and send me the IR after importing in the meantime and I will see what I can figure out.<div class=""><br class=""></div></div><div class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Feb 22, 2016 at 6:02 PM, Mehdi Amini <span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Unfortunately IIRC it involved 800 files, and I don't have them. I need to reproduce and it'll take some time. I can send you the IR *after* importing (the broken module) if it can help (not sure).<span class=""><font color="#888888" class=""><div class=""><br class=""></div><div class="">-- </div><div class="">Mehdi</div></font></span><div class=""><div class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 22, 2016, at 5:52 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Can you give me a test case to reproduce, or at least the IR for the module we're importing from (where these presumably came from) and which function(s) were imported?<div class=""><br class=""></div><div class="">Thanks,</div><div class="">Teresa</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Feb 22, 2016 at 5:37 PM, Mehdi Amini <span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We still have an issue with this patch, when compiling this with thinlto and debug info: <a href="https://github.com/adobe/webkit/blob/master/Source/WebCore/inspector/InspectorRuntimeAgent.cpp" rel="noreferrer" target="_blank" class="">https://github.com/adobe/webkit/blob/master/Source/WebCore/inspector/InspectorRuntimeAgent.cpp</a><br class="">
<br class="">
I haven't had time to narrow it unfortunately, it seems that "baseType" for some DIDerivedType entries are not present.<br class="">
What we see is a broken LLVM Module straight after the FunctionImporter. The output looks like this:<br class="">
<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC14ScopeLabelInfoE"<br class="">
!121713 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTSN3JSC14ScopeLabelInfoE", size: 64, align: 64)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC15DeclarationTypeE"<br class="">
!121577 = !DISubroutineType(types: !121578)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC17AssignmentContextE"<br class="">
!121580 = !DISubroutineType(types: !121581)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC17DestructuringKindE"<br class="">
!121577 = !DISubroutineType(types: !121578)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC21DeclarationImportTypeE"<br class="">
!121606 = !DISubroutineType(types: !121607)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC23SourceProviderCacheItemE"<br class="">
!121621 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTSN3JSC23SourceProviderCacheItemE")<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerIhEEE10LexerStateE"<br class="">
!121743 = !DISubroutineType(types: !121744)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerIhEEE15AutoPopScopeRefE"<br class="">
!121600 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerIhEEE15AutoPopScopeRefE", size: 64, align: 64)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerIhEEE20ExpressionErrorClassE"<br class="">
!121571 = !DISubroutineType(types: !121572)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerIhEEE23AutoCleanupLexicalScopeE"<br class="">
!121604 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerIhEEE23AutoCleanupLexicalScopeE", size: 64, align: 64)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerIhEEE25ExpressionErrorClassifierE"<br class="">
!121535 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerIhEEE25ExpressionErrorClassifierE", size: 64, align: 64)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerIhEEE9SavePointE"<br class="">
!121751 = !DISubroutineType(types: !121752)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerItEEE10LexerStateE"<br class="">
!122000 = !DISubroutineType(types: !122001)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerItEEE15AutoPopScopeRefE"<br class="">
!121866 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerItEEE15AutoPopScopeRefE", size: 64, align: 64)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerItEEE20ExpressionErrorClassE"<br class="">
!121838 = !DISubroutineType(types: !121839)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerItEEE23AutoCleanupLexicalScopeE"<br class="">
!121870 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerItEEE23AutoCleanupLexicalScopeE", size: 64, align: 64)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerItEEE25ExpressionErrorClassifierE"<br class="">
!121803 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerItEEE25ExpressionErrorClassifierE", size: 64, align: 64)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC6ParserINS_5LexerItEEE9SavePointE"<br class="">
!122008 = !DISubroutineType(types: !122009)<br class="">
unresolved type ref<br class="">
!"_ZTSN3JSC9ScopeNodeE"<br class="">
!121635 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTSN3JSC9ScopeNodeE", size: 64, align: 64)<br class="">
<br class="">
<br class="">
--<br class="">
Mehdi<br class="">
<div class=""><div class=""><br class="">
<br class="">
> On Feb 22, 2016, at 2:20 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a>> wrote:<br class="">
><br class="">
> tejohnson updated this revision to Diff 48732.<br class="">
> tejohnson added a comment.<br class="">
><br class="">
> Handle a null MD passed to MapMetadata to address problem reported by<br class="">
> ahatanak.<br class="">
><br class="">
><br class="">
> <a href="http://reviews.llvm.org/D16440" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D16440</a><br class="">
><br class="">
> Files:<br class="">
>  include/llvm/Linker/IRMover.h<br class="">
>  lib/Linker/IRMover.cpp<br class="">
>  lib/Linker/LinkModules.cpp<br class="">
>  lib/Transforms/Utils/ValueMapper.cpp<br class="">
>  test/Linker/thinlto_funcimport_debug.ll<br class="">
>  test/Transforms/FunctionImport/Inputs/funcimport_debug.ll<br class="">
>  test/Transforms/FunctionImport/funcimport_debug.ll<br class="">
><br class="">
</div></div>> <D16440.48732.patch><br class="">
<br class="">
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class=""><span style="font-family:Times;font-size:inherit" class=""><table cellspacing="0" cellpadding="0" class=""><tbody class=""><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small" class=""><td nowrap="" style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px" class="">Teresa Johnson |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px" class=""> Software Engineer |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px" class=""> <a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a> |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px" class=""> <a href="tel:408-460-2413" value="+14084602413" target="_blank" class="">408-460-2413</a></td></tr></tbody></table></span></div>
</div>
</div></blockquote></div><br class=""></div></div></div></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class=""><span style="font-family: Times; font-size: inherit;" class=""><table cellspacing="0" cellpadding="0" class=""><tbody class=""><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small" class=""><td nowrap="" style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px" class="">Teresa Johnson |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px" class=""> Software Engineer |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px" class=""> <a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a> |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px" class=""> <a href="tel:408-460-2413" value="+14084602413" target="_blank" class="">408-460-2413</a></td></tr></tbody></table></span></div>
</div>
</div></div><br class=""></div></div><span class="">_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
<br class=""></span></blockquote></div><br class=""></div>
</blockquote></div></div></div><div class=""><div class=""><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class=""><span style="font-family: Times; font-size: inherit;" class=""><table cellspacing="0" cellpadding="0" class=""><tbody class=""><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small" class=""><td nowrap="" style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px" class="">Teresa Johnson |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px" class=""> Software Engineer |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px" class=""> <a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a> |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px" class=""> <a href="tel:408-460-2413" value="+14084602413" target="_blank" class="">408-460-2413</a></td></tr></tbody></table></span></div>
</div></div></div></div>
</blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature"><span style="font-family: Times; font-size: inherit;" class=""><table cellspacing="0" cellpadding="0" class=""><tbody class=""><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small" class=""><td nowrap="" style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px" class="">Teresa Johnson |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px" class=""> Software Engineer |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px" class=""> <a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a> |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px" class=""> 408-460-2413</td></tr></tbody></table></span></div>
</div>
</div></blockquote></div><br class=""></body></html>