[llvm] r231142 - CFG::SuccessorIterator: Remove explicit copy assignment, as the default is fine

David Blaikie dblaikie at gmail.com
Tue Mar 3 13:58:42 PST 2015


On Tue, Mar 3, 2015 at 1:45 PM, David Blaikie <dblaikie at gmail.com> wrote:

> Author: dblaikie
> Date: Tue Mar  3 15:45:54 2015
> New Revision: 231142
>
> URL: http://llvm.org/viewvc/llvm-project?rev=231142&view=rev
> Log:
> CFG::SuccessorIterator: Remove explicit copy assignment, as the default is
> fine
>
> There's no reason to disallow assigning an iterator from one range to an
> iterator that previously iterated over a disjoint range. This then
> follows the Rule of Zero, allowing implicit copy construction to be used
> without hitting the case that's deprecated in C++11.
>

Missed that the 'Term' member was const. Unconstified in r231146


>
> Modified:
>     llvm/trunk/include/llvm/IR/CFG.h
>
> Modified: llvm/trunk/include/llvm/IR/CFG.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/CFG.h?rev=231142&r1=231141&r2=231142&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/IR/CFG.h (original)
> +++ llvm/trunk/include/llvm/IR/CFG.h Tue Mar  3 15:45:54 2015
> @@ -167,12 +167,6 @@ public:
>        idx = 0;
>    }
>
> -  inline const Self &operator=(const Self &I) {
> -    assert(Term == I.Term &&"Cannot assign iterators to two different
> blocks!");
> -    idx = I.idx;
> -    return *this;
> -  }
> -
>    /// getSuccessorIndex - This is used to interface between code that
> wants to
>    /// operate on terminator instructions directly.
>    unsigned getSuccessorIndex() const { return idx; }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150303/47e63da6/attachment.html>


More information about the llvm-commits mailing list