[llvm] r223763 - Skip declarations in the case of functions.

Michael Ilseman milseman at apple.com
Tue Dec 9 09:19:23 PST 2014


Looking at this more, I agree it’s a little scary. I want to try and catch the case of a declaration as early as we can. The earlier we can assert (or, temporarily, skip), the clearer the intent.

MapValue calls ValueMaterializerTy::materializeValueFor() (if a Materializer is present), which will put the value onto the LazilyLinkGlobalValues. It is LazilyLinkGlobalValues which is being looped over and which yielded a declaration.

Should MapValue ever be allowed to be given a function declaration? I am not familiar with its intended users. If it can’t be allowed, it seems like we should put in the assert. If it can be allowed, then what’s the story for materialization? If we can materialize them, then should we still add them to the LazilyLinkGlobalValues?

I’ll try to get IR for a test case. 

> On Dec 9, 2014, at 5:13 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> 
> On 9 December 2014 at 03:25, Michael Ilseman <milseman at apple.com> wrote:
>> This fixes the problem for me. Unfortunately, I have zero knowledge of the code or its intent. If you get a chance, do you know why this might happen? If you’re unable to, that’s ok. I can probably get Lang to help when he gets back. In the mean time, this is benign, and hopefully we can revert this when we figure out the true problem.
> 
> This is somewhat scary. The code is a bit convoluted, which is why I
> was cleaning it up on the way to also being lazy about variables and
> aliases.
> 
> Have you ever managed to get a reduced testcase? In my experience
> linker bug are really easy to reduce by running delta on the list of
> input functions and using llvm-extract to keep only the ones delta
> selected.
> 
> Cheers,
> Rafael





More information about the llvm-commits mailing list