[llvm] 5fc8cdc - BreadthFirstIterator.h - fix uninitialized variable warning in default constructor. NFCI.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 10:50:50 PDT 2021


I don't think this initialization is needed - it looks like the
default ctor would create a singular/non-incrementable iterator, so
the "level" would not be used in that case?

On Sun, Jun 6, 2021 at 6:17 AM Simon Pilgrim via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>
> Author: Simon Pilgrim
> Date: 2021-06-06T14:13:08+01:00
> New Revision: 5fc8cdcb03e380e6193464eef499d373dcde3708
>
> URL: https://github.com/llvm/llvm-project/commit/5fc8cdcb03e380e6193464eef499d373dcde3708
> DIFF: https://github.com/llvm/llvm-project/commit/5fc8cdcb03e380e6193464eef499d373dcde3708.diff
>
> LOG: BreadthFirstIterator.h - fix uninitialized variable warning in default constructor. NFCI.
>
> Added:
>
>
> Modified:
>     llvm/include/llvm/ADT/BreadthFirstIterator.h
>
> Removed:
>
>
>
> ################################################################################
> diff  --git a/llvm/include/llvm/ADT/BreadthFirstIterator.h b/llvm/include/llvm/ADT/BreadthFirstIterator.h
> index e8af66d7527e..7d728a23b19a 100644
> --- a/llvm/include/llvm/ADT/BreadthFirstIterator.h
> +++ b/llvm/include/llvm/ADT/BreadthFirstIterator.h
> @@ -64,7 +64,7 @@ class bf_iterator : public bf_iterator_storage<SetType> {
>    std::queue<Optional<QueueElement>> VisitQueue;
>
>    // Current level.
> -  unsigned Level;
> +  unsigned Level = 0;
>
>    inline bf_iterator(NodeRef Node) {
>      this->Visited.insert(Node);
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list