[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?

Rob Jansen jansen at cs.umn.edu
Sat Aug 9 09:42:40 PDT 2014


Ahh ha! I believe that `User::replaceUsesOfWith` modifies the use list,
which probably invalidated the use_iterator and caused my code to miss some
of the uses. The following works great! (I'll spare you the details about
what I am actually trying to do here, unless you really want to know more.)

Thanks,
Rob

===========================
while(GV->getNumUses() > 0) {
  User* u = GV->use_back();
  u->replaceUsesOfWith(GV, GEP);
}
assert(GV->use_empty());
===========================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140809/facdf50d/attachment.html>


More information about the llvm-dev mailing list