[LLVMdev] GlobalValues appear in their own use lists?

Chris Lattner clattner at apple.com
Mon Mar 10 21:59:32 PDT 2014


On Mar 10, 2014, at 6:23 PM, Chandler Carruth <chandlerc at google.com> wrote:

> 
> On Mon, Mar 10, 2014 at 6:16 PM, Sean Callanan <scallanan at apple.com> wrote:
> Chris,
> 
> this is a patch against top-of-tree.  Maybe I wrote something wrong in the patch?
> 
> As Chris said, use_iterator walks over the Use objects now, not over the User objects.
> 
> Sadly, a Use *implicitly converts* to the used value. IE, directly back to the Value you called 'use_begin()' on. That is why this assert is firing. =[
> 
> If you want to walk the Users which Use an object (rather than the Use nodes that connect them) use the newly minted Value::user_iterator (or a range based for loop over GV.users()).

Chandler, the implicit conversion is an extremely scary thing now in the presence of both use_iterator and user_iterator.  Can you remove the implicit conversion?  If not, I think we have to get rid of one or the other, or rename them to be less similar.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140310/89c2c42c/attachment.html>


More information about the llvm-dev mailing list