Now discriminator is assigned per-function instead of per-module.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I'm sure it's probably obvious, but you've not mentioned it here - why is
the "right place" the function, and not the module?
Comment Actions
It was mentioned in the FIXME comment I just removed:
- // FIXME: This seems completely wrong.
- //
- // 1. If two modules are generated in the same context, then the second
- // Module will get different discriminators than it would have if it were
- // generated in its own context.
- // 2. If this function is called after round-tripping to bitcode instead of
- // before, it will give a different (and potentially incorrect!) return.
- //
- // The discriminator should instead be calculated from local information
- // where it's actually needed. This logic should be moved to
- // AddDiscriminators::runOnFunction(), where it doesn't pollute the
- // LLVMContext.
Comment Actions
Ah, great - thanks! (& I'd read that, but was reading the patch backwards,
as though that comment was being added, looking at it in more detail the
patch does look great/going in the right direction to be sure - will leave
it to Diego or others to sign off on, though)