[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?

Tim Northover t.p.northover at gmail.com
Sat Aug 9 03:06:52 PDT 2014


Hi Rob,

On 9 August 2014 02:03, Rob Jansen <jansen at cs.umn.edu> wrote:
> Why is the first for loop not equivalent to the second?

In the second loop, "*ui" is an llvm::Use object. It's owned by a
User, but isn't a subclass of one. To match the first loop, you either
need to call Value::user_begin instead of use_begin, or do the cast on
"ui->getUser()".

Cheers.

Tim.



More information about the llvm-dev mailing list