[LLVMdev] Detailed help with cloning the basic blocks of a function

guyadini guyadini at gmail.com
Thu Nov 25 08:48:21 PST 2010


Thank you guys for helping me out with my previous questions.
I am new to LLVM, and I'm getting stuck trying to do some basic stuff:

Currently, I'm trying to move all the basic blocks of one function into
another one,
and at some point insert a branch into the moved function's entry point.

The best way which I've found is to use CloneBasicBlock (from Cloning.h).
However, I don't know how to get the cloned basic block not to use the
of the old basic block. I realize that it has something to do with the
ValueMap that I pass
to the function, but I'm not sure how to use it.

Can someone please show me a short code snippet which does that sort of
It would really help me a lot.

Also, if someone here has an idea for a better way of doing what I'm doing
the basics blocks of one function into another), I'd love to hear that.

Thanks a lot,
View this message in context: http://old.nabble.com/Detailed-help-with-cloning-the-basic-blocks-of-a-function-tp30306839p30306839.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.

More information about the llvm-dev mailing list