[LLVMdev] CloneModule ValueMap

Chris Lattner sabre at nondot.org
Wed May 17 11:06:40 PDT 2006

On Mon, 15 May 2006, Nick Lewycky wrote:

> After cloning a Module with CloneModule, there doesn't seem to be any
> easy way to convert a Value pointing into the old Module to a Value
> pointing into the new one.

Sorry for the delay, your patch looks great, applied!



> The CloneModule implementation already has to keep such a mapping
> internally, so I've written a patch that exposes it as a second inout
> parameter to CloneModule(), with the one param version being a simple
> wrapper for backward compatibility.
> The type of ValueMap is std::map<const Value *, Value*> and the
> semantics are simply:
>  Value *New = ValueMap[Old];
> Nick Lewycky



More information about the llvm-dev mailing list