[PATCH] D141865: [llvm][GenericUniformity] Hack around strict is_invocable() checks

Krzysztof Drewniak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 08:24:18 PST 2023


krzysz00 updated this revision to Diff 490173.
krzysz00 added a comment.

Address review comments


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141865/new/

https://reviews.llvm.org/D141865

Files:
  llvm/include/llvm/ADT/GenericUniformityImpl.h
  llvm/include/llvm/ADT/GenericUniformityInfo.h


Index: llvm/include/llvm/ADT/GenericUniformityInfo.h
===================================================================
--- llvm/include/llvm/ADT/GenericUniformityInfo.h
+++ llvm/include/llvm/ADT/GenericUniformityInfo.h
@@ -63,12 +63,16 @@
 
 private:
   using ImplT = GenericUniformityAnalysisImpl<ContextT>;
-  struct ImplDeleter {
-    void operator()(GenericUniformityAnalysisImpl<ContextT> *Impl);
+  // Ugly hack around the fact that recent (> 15.0) clang will run into an
+  // is_invocable() check in some GNU libc++'s unique_ptr implementation
+  // and reject this deleter if you just make it callable with an ImplT *,
+  // whether or not the type of ImplT is spelled out.
+  template <typename ImplT> struct ImplDeleter {
+    void operator()(ImplT *Impl);
   };
 
   FunctionT *F;
-  std::unique_ptr<ImplT, ImplDeleter> DA;
+  std::unique_ptr<ImplT, ImplDeleter<ImplT>> DA;
 
   GenericUniformityInfo(const GenericUniformityInfo &) = delete;
   GenericUniformityInfo &operator=(const GenericUniformityInfo &) = delete;
Index: llvm/include/llvm/ADT/GenericUniformityImpl.h
===================================================================
--- llvm/include/llvm/ADT/GenericUniformityImpl.h
+++ llvm/include/llvm/ADT/GenericUniformityImpl.h
@@ -468,8 +468,9 @@
 };
 
 template <typename ContextT>
-void GenericUniformityInfo<ContextT>::ImplDeleter::operator()(
-    GenericUniformityAnalysisImpl<ContextT> *Impl) {
+template <typename ImplT>
+void GenericUniformityInfo<ContextT>::ImplDeleter<ImplT>::operator()(
+    ImplT *Impl) {
   delete Impl;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141865.490173.patch
Type: text/x-patch
Size: 1567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230118/95be9138/attachment.bin>


More information about the llvm-commits mailing list