[LLVMdev] Two ExecutionEngines from one Module

Chris Lattner sabre at nondot.org
Sat Mar 31 13:37:15 PDT 2007


On Fri, 30 Mar 2007, Chuck Rose III wrote:
> and at this point I'm in a seeming catch-22.  I can't use the same
> module (I believe) to construct the second ExecutionEngine since
> ownership of the module is already in the first one.

Right, the LLVM ExecutionEngine stuff has been designed with the 
assumption you'd only need one :)

> Zooming around the
> class hierarchy didn't seem to yield a good way to do a deep copy on a
> Module, which I could have done before constructing any given
> ExecutionEngine and thus sidestep the ownership issue.

If copying the module is acceptable, check out 
llvm/Transforms/Utils/Cloning.h

CloneModule(M);

Which does a deep copy of the module.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list