[clang] Add the support for recognizing WTF::move like std::move (PR #170820)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 9 13:47:54 PST 2025


================
@@ -185,6 +185,15 @@ bool isCtorOfSafePtr(const clang::FunctionDecl *F) {
          isCtorOfRetainPtrOrOSPtr(F);
 }
 
+bool isStdOrWTFMove(const clang::FunctionDecl *F) {
+  auto FnName = safeGetName(F);
+  auto *Namespace = F->getParent();
+  if (!Namespace)
+    return false;
+  auto NsName = safeGetName(Namespace);
+  return (NsName == "WTF" || NsName == "std") && FnName == "move";
+}
----------------
steakhal wrote:

Have you considered using isa_and_nonnull? Fusing the disjunction?

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


More information about the cfe-commits mailing list