When I insert an Instruction into a BasicBlock with the method
BasicBlock::getInstList().push_front(*Instruction);
But when did it set the Instruction's parent to current BasicBlock?
The code is as follow and worked well. I just want to know when and where set the parent of the cloned Instruction.
Thanks.
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?