[LLVMdev] Module::getOrInsertFunction determinism

Kuchta, Tomasz t.kuchta12 at imperial.ac.uk
Thu Jun 5 05:43:22 PDT 2014


Hi Philip, Dan,

Thank you very much for you comments.

The exact place was:
Archive::findModulesDefiningSymbols() function, that is called from
Linker::LinkInArchive.
I am using LLVM version 2.9.

I couldn¹t find either of these two functions in LLVM3.4, but as Dan
suggests, 
this functionality was removed in 3.3, so that should be correct now.

Thanks!

Tomek

On 05/06/2014 00:20, "Dan Liew" <dan at su-root.co.uk> wrote:

>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