Displaying 3 results from an estimated 3 matches for "linkmodulefromdifferentcontext".
2015 Jun 01
2
[LLVMdev] Linking modules across contexts crashes
...ed by its LLVMContext (types, constants, metadata, and some
other things).
> Is this not the right way to merge such modules? If not, then what is the right way?
You can round-trip to bitcode, reading the module into the
destination context. The following pseudo-code gives the idea:
bool linkModuleFromDifferentContext(Module &D, const Module &S) {
SmallVector<char, 256> Buffer;
writeBitcodeToBuffer(S, Buffer);
std::unique_ptr<Module> M = readBitcodeFromBuffer(D.getContext());
return Linker::LinkModules(&D, M.get());
}
> In any case, documentation for Linke...
2015 Jun 02
2
[LLVMdev] Linking modules across contexts crashes
...gt; On 2015-Jun-02, at 12:37, Yuri <yuri at rawbw.com> wrote:
>
> On 06/01/2015 11:43, Duncan P. N. Exon Smith wrote:
>> You can round-trip to bitcode, reading the module into the
>> destination context. The following pseudo-code gives the idea:
>>
>> bool linkModuleFromDifferentContext(Module &D, const Module &S) {
>> SmallVector<char, 256> Buffer;
>> writeBitcodeToBuffer(S, Buffer);
>>
>> std::unique_ptr<Module> M = readBitcodeFromBuffer(D.getContext());
>> return Linker::LinkModules(&D, M.get());
>...
2015 May 30
2
[LLVMdev] Linking modules across contexts crashes
I get a crash when I try to link multiple modules registered in their
individual contexts.
Documentation for Linker::LinkModules doesn't mention anything about
contexts, and the first link succeeds. But the second link crashes.
Is this not the right way to merge such modules? If not, then what is
the right way?
In any case, documentation for Linker::LinkModules should say if
contexts are