move function body, avoiding full cloning

倾然丶 夕夏残阳落幕 提交于 2019-12-06 05:59:07

Shamelessly stolen from the Arg Promotion pass (search for splice):

// Since we have now created the new function, splice the body of the old
// function right into the new function, leaving the old rotting hulk of the
// function empty.
NF->getBasicBlockList().splice(NF->begin(), F->getBasicBlockList());

Where NF is the new function you're cloning into and F is the old function that you have just cloned.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!