module functions

Hi.

I would like to move first function of module to end. To do this, I remove function from module, then I insert it with getOrInsertFunction() method. It worked. But there is a problem: I can’t see body of function (basic blocks). In other words, function basic blocks don’t move.

To solve, I store function basic blocks before remove it. and after function insertion, I want to insert them to function. But when I want to add them with insertInto() method, this error appears:
no member named ‘insertInto’ in ‘llvm::BasicBlock’.

I’m confused. I sure this method exists in BasicBlock class.

Any help? Thanks.

To solve, I store function basic blocks before remove it. and after function
insertion, I want to insert them to function. But when I want to add them
with insertInto() method, this error appears:
no member named 'insertInto' in 'llvm::BasicBlock'.
I'm confused. I sure this method exists in BasicBlock class.

It seems to have been added after 3.5 branched, are you looking at
documentation for trunk but compiling against an older LLVM?

You might have slightly better luck with
"Module->getFunctionList().push_back(OldFunc)" though. I wouldn't
swear to it working, but if it did you wouldn't need to mess around
with saving and restoring the basic blocks.

Cheers.

Tim.