On Fri, Feb 22, 2013 at 11:19 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">>  Linkage NamedDecl::getLinkage() const {<br>
> -  if (HasCachedLinkage) {<br>
> -    assert(Linkage(CachedLinkage) ==<br>
> -           getLVForDecl(this, true).linkage());<br>
> +  if (HasCachedLinkage)<br>
>      return Linkage(CachedLinkage);<br>
> -  }<br>
<br>
</div>This was one of my favorites asserts :-(<br>
<br>
Would the attached patch be OK?</blockquote><div><br></div><div>We can't call getCachedLinkage on both functions in isSameEntity. We only know one of them has cached linkage, not both.</div><div><br></div><div>IMO, the right way to fix this is to get rid of the linkage cache, and compute and store linkage when an entity is first declared. We only need caching and recomputation for visibility.</div>
</div>