[llvm] [ADT] Deprecate the redirection from SmallSet to SmallPtrSet (PR #154891)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 21 22:17:42 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-adt
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
This patch deprecates the redirection from SmallSet to SmallPtrSet.
I attempted to deprecate in the usual manner:
template <typename PointeeType, unsigned N>
LLVM_DEPRECATED("...", "...")
class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {};
However, the deprecation warning wouldn't fire.
For this reason, I've attached a deprecation message to the default
constructor.
---
Full diff: https://github.com/llvm/llvm-project/pull/154891.diff
1 Files Affected:
- (modified) llvm/include/llvm/ADT/SmallSet.h (+7-1)
``````````diff
diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h
index eb434bcb71717..427a89c906fd3 100644
--- a/llvm/include/llvm/ADT/SmallSet.h
+++ b/llvm/include/llvm/ADT/SmallSet.h
@@ -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;
+};
/// Equality comparison for SmallSet.
///
``````````
</details>
https://github.com/llvm/llvm-project/pull/154891
More information about the llvm-commits
mailing list