[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?

Tim Northover t.p.northover at gmail.com
Sat Aug 9 09:50:32 PDT 2014


On 9 August 2014 17:42, Rob Jansen <jansen at cs.umn.edu> wrote:
> 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.

Ah yes, that would explain it. Sorry I wasn't much help.

You could also safely increment the iterator before removing the use,
I think (which has the benefit of not being a quadratic algorithm).

Cheers.

Tim.



More information about the llvm-dev mailing list