[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?

Rob Jansen jansen at cs.umn.edu
Sat Aug 9 07:26:14 PDT 2014


On Sat, Aug 9, 2014 at 6:06 AM, Tim Northover <t.p.northover at gmail.com>
wrote:

> 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()".
>

I think this is incorrect since the use_iterator is defined as:

`typedef value_use_iterator<User> use_iterator;`

and indeed `ui->getUser();` is not a callable function on a User. What am I
missing?

-Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140809/ed8317a4/attachment.html>


More information about the llvm-dev mailing list