[PATCH] D21076: [DSE] Ignore dbg value when instruction iterator is reset.

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 16:39:16 PDT 2016


On Mon, Jun 13, 2016 at 4:29 PM, Sean Silva <chisophugis at gmail.com> wrote:

> silvas added a subscriber: silvas.
> silvas added a comment.
>
> In http://reviews.llvm.org/D21076#456942, @dberlin wrote:
>
> > Note: bb->eraseFromParent now returns an iterator, so you can fix this
> by returning and using that instead  :)
>
>
> Sorry, this is sort of a side comment: what iterator does it return? I'm
> having a hard time seeing based on the docs.
>
>
>
Yeah, sadly, \return gets put only in the details you have to expand to see:

It says:

"
*...*
*Returns:*an iterator pointing to the element after the erased one

Definition at line 75
<http://llvm.org/docs/doxygen/html/Instruction_8cpp_source.html#l00075> of
file Instruction.cpp
<http://llvm.org/docs/doxygen/html/Instruction_8cpp_source.html>.
"

It's just returning with ilist->erase returns, which is the element after
the erased one.
(or ->end() if there is no such element)

You can convert this to either a forward or reverse iterator directly,
because it's an ilist.



> http://reviews.llvm.org/D21076
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160613/85d5932e/attachment.html>


More information about the llvm-commits mailing list