<div dir="ltr">Hmm, what I am wondering is why any of these were brought into the final module. The DISubprogram wasn't imported since it isn't a definition. For the enum to have been brought in it must have been needed in some fashion by an imported function.<div><br></div><div>Mehdi, feel free to send me the big merged file if you want.</div><div><br></div><div>Thanks,</div><div>Teresa<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 23, 2016 at 9:14 AM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">FYI, I had a quick look at the big merged file.  I walked back from one of<br>
the unresolved types:<br>
```<br>
!"_ZTSN3JSC6ParserINS_5LexerItEEEE" => used by !DIDerivedType(pointer) // via baseType:<br>
!DIDerivedType() => used by !DISubroutineType() // via types:<br>
!DISubroutineType() => used by !DISubprogram() // via type:<br>
// note: isDefinition: false<br>
!DISubprogram(isDefinition: false) => used by !DICompositeType(class) // via elements:<br>
// note: class has identifier:, but not listed directly in a compile unit!<br>
!DICompositeType(class) => used by !DICompositeType(enum) // via: scope:<br>
!DICompositeType(enum) => used by !DICompileUnit() // via: retainedTypes:<br>
```<br>
<br>
The weird thing I noticed: there was a class in the chain that had an identifier<br>
but was also not directly listed in retained types.<br>
<br>
Maybe this will help someone come up with a reproducer?<br>
<div><div><br>
<br>
> On 2016-Feb-22, at 20:24, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>> wrote:<br>
><br>
> I didn't expect any miracle from you :)<br>
> My intention was just mentioning that the patch shouldn't be committed as there is a known bug, and I obviously will try to give a reasonably small repro ASAP.<br>
><br>
> --<br>
> Mehdi<br>
><br>
>> On Feb 22, 2016, at 7:39 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>> wrote:<br>
>><br>
>> 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.<br>
>><br>
>><br>
>> On Mon, Feb 22, 2016 at 6:02 PM, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>> wrote:<br>
>> 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).<br>
>><br>
>> --<br>
>> Mehdi<br>
>><br>
>><br>
>><br>
>>> On Feb 22, 2016, at 5:52 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>> wrote:<br>
>>><br>
>>> 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?<br>
>>><br>
>>> Thanks,<br>
>>> Teresa<br>
>>><br>
>>> On Mon, Feb 22, 2016 at 5:37 PM, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>> wrote:<br>
>>> 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">https://github.com/adobe/webkit/blob/master/Source/WebCore/inspector/InspectorRuntimeAgent.cpp</a><br>
>>><br>
>>> I haven't had time to narrow it unfortunately, it seems that "baseType" for some DIDerivedType entries are not present.<br>
>>> What we see is a broken LLVM Module straight after the FunctionImporter. The output looks like this:<br>
>>><br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC14ScopeLabelInfoE"<br>
>>> !121713 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTSN3JSC14ScopeLabelInfoE", size: 64, align: 64)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC15DeclarationTypeE"<br>
>>> !121577 = !DISubroutineType(types: !121578)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC17AssignmentContextE"<br>
>>> !121580 = !DISubroutineType(types: !121581)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC17DestructuringKindE"<br>
>>> !121577 = !DISubroutineType(types: !121578)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC21DeclarationImportTypeE"<br>
>>> !121606 = !DISubroutineType(types: !121607)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC23SourceProviderCacheItemE"<br>
>>> !121621 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTSN3JSC23SourceProviderCacheItemE")<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerIhEEE10LexerStateE"<br>
>>> !121743 = !DISubroutineType(types: !121744)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerIhEEE15AutoPopScopeRefE"<br>
>>> !121600 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerIhEEE15AutoPopScopeRefE", size: 64, align: 64)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerIhEEE20ExpressionErrorClassE"<br>
>>> !121571 = !DISubroutineType(types: !121572)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerIhEEE23AutoCleanupLexicalScopeE"<br>
>>> !121604 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerIhEEE23AutoCleanupLexicalScopeE", size: 64, align: 64)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerIhEEE25ExpressionErrorClassifierE"<br>
>>> !121535 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerIhEEE25ExpressionErrorClassifierE", size: 64, align: 64)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerIhEEE9SavePointE"<br>
>>> !121751 = !DISubroutineType(types: !121752)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerItEEE10LexerStateE"<br>
>>> !122000 = !DISubroutineType(types: !122001)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerItEEE15AutoPopScopeRefE"<br>
>>> !121866 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerItEEE15AutoPopScopeRefE", size: 64, align: 64)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerItEEE20ExpressionErrorClassE"<br>
>>> !121838 = !DISubroutineType(types: !121839)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerItEEE23AutoCleanupLexicalScopeE"<br>
>>> !121870 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerItEEE23AutoCleanupLexicalScopeE", size: 64, align: 64)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerItEEE25ExpressionErrorClassifierE"<br>
>>> !121803 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTSN3JSC6ParserINS_5LexerItEEE25ExpressionErrorClassifierE", size: 64, align: 64)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC6ParserINS_5LexerItEEE9SavePointE"<br>
>>> !122008 = !DISubroutineType(types: !122009)<br>
>>> unresolved type ref<br>
>>> !"_ZTSN3JSC9ScopeNodeE"<br>
>>> !121635 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTSN3JSC9ScopeNodeE", size: 64, align: 64)<br>
>>><br>
>>><br>
>>> --<br>
>>> Mehdi<br>
>>><br>
>>><br>
>>> > On Feb 22, 2016, at 2:20 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>> wrote:<br>
>>> ><br>
>>> > tejohnson updated this revision to Diff 48732.<br>
>>> > tejohnson added a comment.<br>
>>> ><br>
>>> > Handle a null MD passed to MapMetadata to address problem reported by<br>
>>> > ahatanak.<br>
>>> ><br>
>>> ><br>
>>> > <a href="http://reviews.llvm.org/D16440" rel="noreferrer" target="_blank">http://reviews.llvm.org/D16440</a><br>
>>> ><br>
>>> > Files:<br>
>>> >  include/llvm/Linker/IRMover.h<br>
>>> >  lib/Linker/IRMover.cpp<br>
>>> >  lib/Linker/LinkModules.cpp<br>
>>> >  lib/Transforms/Utils/ValueMapper.cpp<br>
>>> >  test/Linker/thinlto_funcimport_debug.ll<br>
>>> >  test/Transforms/FunctionImport/Inputs/funcimport_debug.ll<br>
>>> >  test/Transforms/FunctionImport/funcimport_debug.ll<br>
>>> ><br>
>>> > <D16440.48732.patch><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Teresa Johnson |     Software Engineer |     <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |  <a href="tel:408-460-2413" value="+14084602413" target="_blank">408-460-2413</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Teresa Johnson |      Software Engineer |     <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |  <a href="tel:408-460-2413" value="+14084602413" target="_blank">408-460-2413</a><br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><span style="font-family:Times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> <a href="tel:408-460-2413" value="+14084602413" target="_blank">408-460-2413</a></td></tr></tbody></table></span></div>
</div></div></div>