<div class="gmail_quote"><div>Hi Jeffrey,</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
> This should be guarded by a lazy compilation enabled check.<br>
<br>
</div>What's the actual failure you see? As far as I understand, it's lazy<br>
bitcode loading that causes functions to have ghost linkage, not lazy<br>
compilation.<br></blockquote><div><br></div><div>Yes, sorry, that was lazy bitcode loading. This should not be triggered here. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
Until <a href="http://llvm.org/bugs/show_bug.cgi?id=5737" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=5737</a> is fixed, there's no<br>
way to tell whether a ghost function is available_externally without<br>
materializing it, so I'd expect not having this to break all users of<br>
lazy bitcode loading, not just users who also compile lazily.<br>
<div class="im"><br></div></blockquote><div><br></div><div>Ah, that's unfortunate. Two things incompatible with each other....  Still, the behavior was OK before your change, so I guess both ways do not fix PR5737. I'd really like to see the old behavior coming back again until a proper fix to PR5737 is submitted.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">Declaration() || F->hasAvailableExternallyLinkage()) {<br>
><br>
> Why remove the hasNotBeenReadFromBitcode? The hasNotBeenReadFromBitcode<br>
> function verifies that the linkage of the function is GhostLinkage, which is<br>
> used by lazy compilation. So users that use lazy compilation require the<br>
> call to hasNotBeenReadFromBitcode.<br>
<br>
</div>Given the above call to materializeFunction(F),<br>
hasNotBeenReadFromBitcode should always be false, so testing it is<br>
redundant. I could add an assert() if you want.<br>
<div><div></div><div class="h5"><br></div></div></blockquote><div><br></div><div>No, the matierialize function should not be there in the first place.</div><div><br></div><div>Nicolas </div></div>