【发布时间】:2018-04-26 05:59:46
【问题描述】:
当我使用方法将指令插入 BasicBlock 时
BasicBlock::getInstList().push_front(*Instruction);
但它何时将指令的父级设置为当前的 BasicBlock?
代码如下,运行良好。我只想知道何时何地设置克隆指令的父级。
谢谢。
Instruction *ori_inst = cur_inst->clone();
//until now, the ori_inst does not have it's parent
CUR_BB->getInstList().push_front(ori_inst);
//now, the ori_inst has CUR_BB as it's parent, why?
【问题讨论】: