[llvm] [ADT] Deprecate the redirection from SmallSet to SmallPtrSet (PR #154891)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 10:51:18 PDT 2025


================
@@ -269,7 +269,13 @@ class SmallSet {
 /// If this set is of pointer values, transparently switch over to using
 /// SmallPtrSet for performance.
 template <typename PointeeType, unsigned N>
-class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {};
+class SmallSet<PointeeType *, N> : public SmallPtrSet<PointeeType *, N> {
+public:
+  // LLVM_DEPRECATED placed between "template" and "class" above won't work for
+  // some reason.  Put a deprecation message on the default constructor instead.
+  LLVM_DEPRECATED("Use SmallPtrSet instead", "SmallPtrSet")
+  SmallSet<PointeeType *, N>() = default;
----------------
kuhar wrote:

Should we also deprecate the other constructors? I imagine that the copy constructor and the constructor taking iterator pair is also popular.

https://github.com/llvm/llvm-project/pull/154891


More information about the llvm-commits mailing list