[PATCH] D92480: [llvm] Unify interface of (ThreadSafe)?RefCountedBase

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 16:25:05 PST 2020


njames93 added reviewers: chandlerc, dblaikie.
njames93 added inline comments.


================
Comment at: clang/lib/ASTMatchers/ASTMatchersInternal.cpp:190-196
+// Use a custom deleter for the TrueMatcherInstance ManagedStatic. This prevents
+// an assert firing when the refcount is nonzero while running its destructor.
+struct DynMatcherInterfaceDeleter {
+  static void call(void *Ptr) {
+    static_cast<DynMatcherInterface *>(Ptr)->Release();
+  }
+};
----------------
Is this a case that happens in other places, ManagedStatics holding RefCounted objects, if so this could be extracted and reused in other places.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92480



More information about the cfe-commits mailing list