Displaying 2 results from an estimated 2 matches for "previous_position".
2011 May 09
2
[LLVMdev] <badref> showed up when duplicating a list of dependent instructions
...{basically, I want to duplicate the bkp_memory() call, everything else
are its dependent instructions.}
I put them into a std::vector<Instruction *> coll, with the following
code trying to do the replication and insertion:
std::vector<Instruction *>::iterator p;
Instruction * pi = PREVIOUS_POSITION;
BasicBlock * pb = PREVIOUS_POSITION->getParent();
for(p = coll.begin(); p != coll.end(); ++p){
Instruction * CurI = * p;
Instruction * CloneI = CurI->clone();
CloneI->setName(CurI->getName());
errs() << *CloneI << "\n";
pb->getInstList().in...
2011 May 09
0
[LLVMdev] <badref> showed up when duplicating a list of dependent instructions
Hi Chuck,
> std::vector<Instruction *>::iterator p;
> Instruction * pi = PREVIOUS_POSITION;
> BasicBlock * pb = PREVIOUS_POSITION->getParent();
>
> for(p = coll.begin(); p != coll.end(); ++p){
> Instruction * CurI = * p;
> Instruction * CloneI = CurI->clone();
clone doesn't know have any magical way of knowing that it should update the
instruction's operands...