Does LLVM offer any way of obtaining a deep copy of a CFG, that is all the basic blocks of a function and their instructions. I'm asking because I would like to implement continuations in my VM and I need to create a modified version of some functions. I thought a simple way of doing this would be to modify a copy of the code generated for the orignal function. This would be simpler than modifying all my VM logic to generate a brand new CFG (and less time consuming). - Maxime -- View this message in context: http://www.nabble.com/Basic-Block---CFG-Deep-Copy--tp23913838p23913838.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
Nyx wrote:> Does LLVM offer any way of obtaining a deep copy of a CFG, that is all the > basic blocks of a function and their instructions.CloneModule and CloneFunction do what they say on the box. CloneTrace takes a vector<BasicBlock*> and produces a new function that includes just those basic blocks. This is useful for tracing based JITs. They're declared in include/llvm/Transforms/Utils/Cloning.h. Nick> I'm asking because I would like to implement continuations in my VM and I > need to create a modified version of some functions. I thought a simple way > of doing this would be to modify a copy of the code generated for the > orignal function. This would be simpler than modifying all my VM logic to > generate a brand new CFG (and less time consuming). > > - Maxime