Skip to content

Conversation

@benlangmuir
Copy link
Collaborator

The previous version introduce an extra level of pointer indirection.

The previous version introduce an extra level of pointer indirection.
@llvmbot
Copy link
Member

llvmbot commented Aug 23, 2025

@llvm/pr-subscribers-llvm-adt

Author: Ben Langmuir (benlangmuir)

Changes

The previous version introduce an extra level of pointer indirection.


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

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/SmallSet.h (+2-2)
diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h
index 96a68fb8da0e2..4c60b15224a45 100644
--- a/llvm/include/llvm/ADT/SmallSet.h
+++ b/llvm/include/llvm/ADT/SmallSet.h
@@ -272,9 +272,9 @@ class SmallSet {
 /// We use this middleman class DeprecatedSmallSet so that the deprecation
 /// warning works.  Placing LLVM_DEPRECATED just before SmallSet below won't
 /// work.
-template <typename PointeeType, unsigned N>
+template <typename PointerType, unsigned N>
 class LLVM_DEPRECATED("Use SmallPtrSet instead", "SmallPtrSet")
-    DeprecatedSmallSet : public SmallPtrSet<PointeeType *, N> {};
+    DeprecatedSmallSet : public SmallPtrSet<PointerType, N> {};
 
 template <typename PointeeType, unsigned N>
 class SmallSet<PointeeType *, N> : public DeprecatedSmallSet<PointeeType *, N> {

@benlangmuir
Copy link
Collaborator Author

I spent a while trying to write a test or static_assert for this but couldn't find one that didn't emit a warning. The usual LLVM_SUPPRESS_DEPRECATED_DECLARATIONS_PUSH didn't work, because the warning location is on the SmallSet : public DeprecatedSmallSet line and we specifically want that to emit a warning if it gets used. Let me know if you have an idea.

Copy link
Contributor

@kazutakahirata kazutakahirata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for fixing this!

@benlangmuir
Copy link
Collaborator Author

Unrelated test failure. Merging

@benlangmuir benlangmuir merged commit 3ca1ca4 into llvm:main Aug 23, 2025
9 of 11 checks passed
@benlangmuir benlangmuir deleted the fix-smallset-redirect branch August 23, 2025 19:22
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 23, 2025

LLVM Buildbot has detected a new failure on builder clang-m68k-linux-cross running on suse-gary-m68k-cross while building llvm at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/15041

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
...
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Frontend/CompilerInstance.h:15,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/StaticAnalyzer/CheckerRegistration.h:10,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp:9:
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include/llvm/ADT/SmallSet.h:280:43: warning: ‘template<class PointerType, unsigned int N> class llvm::DeprecatedSmallSet’ is deprecated: Use SmallPtrSet instead [-Wdeprecated-declarations]
  280 | class SmallSet<PointeeType *, N> : public DeprecatedSmallSet<PointeeType *, N> {
      |                                           ^~~~~~~~~~~~~~~~~~
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include/llvm/ADT/SmallSet.h:277:5: note: declared here
  277 |     DeprecatedSmallSet : public SmallPtrSet<PointerType, N> {};
      |     ^~~~~~~~~~~~~~~~~~
[170/430] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TransferTest.cpp.o
FAILED: tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TransferTest.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Tooling -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googletest/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG -std=c++17  -Wno-variadic-macros -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TransferTest.cpp.o -MF tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TransferTest.cpp.o.d -o tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TransferTest.cpp.o -c /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
In file included from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/AST/CXXInheritance.h:24,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/ASTMatchers/ASTMatchers.h:50,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/ASTMatchers/ASTMatchFinder.h:43,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Analysis/FlowSensitive/TestingSupport.h:27,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:9:
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include/llvm/ADT/SmallSet.h:280:43: warning: ‘template<class PointerType, unsigned int N> class llvm::DeprecatedSmallSet’ is deprecated: Use SmallPtrSet instead [-Wdeprecated-declarations]
  280 | class SmallSet<PointeeType *, N> : public DeprecatedSmallSet<PointeeType *, N> {
      |                                           ^~~~~~~~~~~~~~~~~~
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include/llvm/ADT/SmallSet.h:277:5: note: declared here
  277 |     DeprecatedSmallSet : public SmallPtrSet<PointerType, N> {};
      |     ^~~~~~~~~~~~~~~~~~
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[171/430] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ByteCode/toAPValue.cpp.o
In file included from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/AST/CXXInheritance.h:24,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/ASTMatchers/ASTMatchers.h:50,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/ASTMatchers/ASTMatchFinder.h:43,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/AST/ByteCode/toAPValue.cpp:6:
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include/llvm/ADT/SmallSet.h:280:43: warning: ‘template<class PointerType, unsigned int N> class llvm::DeprecatedSmallSet’ is deprecated: Use SmallPtrSet instead [-Wdeprecated-declarations]
  280 | class SmallSet<PointeeType *, N> : public DeprecatedSmallSet<PointeeType *, N> {
      |                                           ^~~~~~~~~~~~~~~~~~
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include/llvm/ADT/SmallSet.h:277:5: note: declared here
  277 |     DeprecatedSmallSet : public SmallPtrSet<PointerType, N> {};
      |     ^~~~~~~~~~~~~~~~~~
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/AST/ByteCode/toAPValue.cpp: In member function ‘virtual void ToAPValue_Pointers_Test::TestBody()’:
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/AST/ByteCode/toAPValue.cpp:97:20: warning: possibly dangling reference to a temporary [-Wdangling-reference]
   97 |     const Pointer &GP = getGlobalPtr("arrp").deref<Pointer>();
      |                    ^~
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/AST/ByteCode/toAPValue.cpp:97:60: note: the temporary was destroyed at the end of the full expression ‘ToAPValue_Pointers_Test::TestBody()::<lambda(const char*)>(((const char*)"arrp")).clang::interp::Pointer::deref<clang::interp::Pointer>()’
   97 |     const Pointer &GP = getGlobalPtr("arrp").deref<Pointer>();
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
[172/430] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/StaticAnalyzer/ParamRegionTest.cpp.o
In file included from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/AST/CXXInheritance.h:24,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/ASTMatchers/ASTMatchers.h:50,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/ASTMatchers/ASTMatchFinder.h:43,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/StaticAnalyzer/Reusables.h:12,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/StaticAnalyzer/ParamRegionTest.cpp:9:

joker-eph added a commit to joker-eph/llvm-project that referenced this pull request Aug 27, 2025
…(Take 2) (llvm#155078)"

This reverts commit 9b493dc.

There are hundreds of warnings when building LLVM/Clang because of this right now.
See the original PR for the detailed issues.

Also revert the follow-up fix "[ADT] Fix redirection of SmallSet to SmallPtrSet (llvm#155117)"
This reverts commit 3ca1ca4.
joker-eph added a commit that referenced this pull request Aug 27, 2025
…(Take 2) (#155078) (#155622)

This reverts commit 9b493dc.

There are hundreds of warnings when building LLVM/Clang because of this
right now. See the original PR for the detailed issues.

Also revert the follow-up fix "[ADT] Fix redirection of SmallSet to
SmallPtrSet (#155117)" This reverts commit
3ca1ca4.
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