[all-commits] [llvm/llvm-project] 8719fa: [ADT] Make SmallSet::insert(const T &) return cons...

Piggy via All-commits all-commits at lists.llvm.org
Sun Aug 14 22:55:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8719faafdb3f2eb4971201a9286e24e227cc9d8f
      https://github.com/llvm/llvm-project/commit/8719faafdb3f2eb4971201a9286e24e227cc9d8f
  Author: Zijia Zhu <piggynl at outlook.com>
  Date:   2022-08-15 (Mon, 15 Aug 2022)

  Changed paths:
    M llvm/include/llvm/ADT/SmallSet.h
    M llvm/unittests/ADT/SmallSetTest.cpp

  Log Message:
  -----------
  [ADT] Make SmallSet::insert(const T &) return const_iterator

This patch makes `SmallSet::insert(const T &)` return
`std::pair<const_iterator, bool>` instead of
`std::pair<NoneType, bool>`. This will exactly match std::set's behavior
and make deduplicating items with SmallSet easier.

Reviewed By: dblaikie, lattner

Differential Revision: https://reviews.llvm.org/D131549




More information about the All-commits mailing list