search for: writebitcodetobuffer

Displaying 3 results from an estimated 3 matches for "writebitcodetobuffer".

2015 Jun 01
2
[LLVMdev] Linking modules across contexts crashes
...ch 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 Linker::LinkModules should say if contexts are or aren't expected to be the same. Good idea; patch welcome....
2015 Jun 02
2
[LLVMdev] Linking modules across contexts crashes
...gt; 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()); >> } > > Duncan, > > Thanks for this workaround, i works. However, going to binary and back causes the si...
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