Skip to content

Conversation

kazutakahirata
Copy link
Contributor

This patch teaches SmallSetVector to inherit constructors from the
base class with "using". This way, we can remove all of the manually
defined constructors in SmallSetVector.

This patch teaches SmallSetVector to inherit constructors from the
base class with "using".  This way, we can remove all of the manually
defined constructors in SmallSetVector.
@llvmbot
Copy link
Member

llvmbot commented Aug 28, 2025

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

Changes

This patch teaches SmallSetVector to inherit constructors from the
base class with "using". This way, we can remove all of the manually
defined constructors in SmallSetVector.


Full diff: https://github.com/llvm/llvm-project/pull/155788.diff

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/SetVector.h (+1-11)
diff --git a/llvm/include/llvm/ADT/SetVector.h b/llvm/include/llvm/ADT/SetVector.h
index 85d4f2d5ee28a..deed62187ee12 100644
--- a/llvm/include/llvm/ADT/SetVector.h
+++ b/llvm/include/llvm/ADT/SetVector.h
@@ -377,17 +377,7 @@ class SetVector {
 template <typename T, unsigned N>
 class SmallSetVector : public SetVector<T, SmallVector<T, N>, DenseSet<T>, N> {
 public:
-  SmallSetVector() = default;
-
-  /// Initialize a SmallSetVector with a range of elements
-  template<typename It>
-  SmallSetVector(It Start, It End) {
-    this->insert(Start, End);
-  }
-
-  template <typename Range>
-  SmallSetVector(llvm::from_range_t, Range &&R)
-      : SmallSetVector(adl_begin(R), adl_end(R)) {}
+  using SetVector<T, SmallVector<T, N>, DenseSet<T>, N>::SetVector;
 };
 
 } // end namespace llvm

@kazutakahirata kazutakahirata merged commit 42f992f into llvm:main Aug 28, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250827_SetVector_SmallSetVector_ctor branch August 28, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants