[LLVMdev] Module::getOrInsertFunction determinism

Dan Liew dan at su-root.co.uk
Wed Jun 4 16:20:18 PDT 2014


On 4 June 2014 10:32, Kuchta, Tomasz <t.kuchta12 at imperial.ac.uk> wrote:
> Hi Philip,
>
> Thank you very much for your comments.
> I think I’ve discovered a root cause. The problem was in linking bit code
> archive files with the module.
> At some point, std::set<Module*> is used and iterated over.

If there is a std::set<Module*> this sounds like the old linking code
(Linker::LinkInFile). That code was removed in LLVM3.3 and it is no
longer possible to link archives of bitcode modules directly using the
LLVM API.

I implemented a hacky replacement[1] in upstream KLEE. So if you
upgrade you might find this works fine Tomek.

However I fundamentally believe KLEE's approach is wrong here because
I think linking and most optimisations should be done outside of KLEE
but I'm not really interested in fixing this right now.


[1] https://github.com/klee/klee/blob/master/lib/Module/ModuleUtil.cpp#L345

Thanks,
-- 
Dan Liew
PhD Student - Imperial College London




More information about the llvm-dev mailing list