[Lldb-commits] [lldb] [lldb] Remove HasCallbackParameter (PR #150366)

Kazu Hirata via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 23 21:00:28 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/150366

None

>From d2b134f3885eca8ad499303cf986a6f3e9e6c0cb Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 23 Jul 2025 20:48:04 -0700
Subject: [PATCH] [lldb] Remove HasCallbackParameter

---
 lldb/tools/lldb-rpc-gen/RPCCommon.cpp | 14 --------------
 lldb/tools/lldb-rpc-gen/RPCCommon.h   |  1 -
 2 files changed, 15 deletions(-)

diff --git a/lldb/tools/lldb-rpc-gen/RPCCommon.cpp b/lldb/tools/lldb-rpc-gen/RPCCommon.cpp
index 6f0abe4b1ae87..7af6ee37f248b 100644
--- a/lldb/tools/lldb-rpc-gen/RPCCommon.cpp
+++ b/lldb/tools/lldb-rpc-gen/RPCCommon.cpp
@@ -308,20 +308,6 @@ bool lldb_rpc_gen::MethodIsDisallowed(ASTContext &Context,
   return isDisallowed;
 }
 
-bool lldb_rpc_gen::HasCallbackParameter(CXXMethodDecl *MDecl) {
-  bool HasCallbackParameter = false;
-  bool HasBatonParameter = false;
-  auto End = MDecl->parameters().end();
-  for (auto Iter = MDecl->parameters().begin(); Iter != End; Iter++) {
-    if ((*Iter)->getType()->isFunctionPointerType())
-      HasCallbackParameter = true;
-    else if ((*Iter)->getType()->isVoidPointerType())
-      HasBatonParameter = true;
-  }
-
-  return HasCallbackParameter && HasBatonParameter;
-}
-
 // NOTE: There's possibly a more clever way to do this, but we're keeping
 // the string replacement way here. Here is why it is written this way:
 // By the time we have already created a `Method` object, we have extracted the
diff --git a/lldb/tools/lldb-rpc-gen/RPCCommon.h b/lldb/tools/lldb-rpc-gen/RPCCommon.h
index edc03b4f81a3d..2a309d05e5ef7 100644
--- a/lldb/tools/lldb-rpc-gen/RPCCommon.h
+++ b/lldb/tools/lldb-rpc-gen/RPCCommon.h
@@ -32,7 +32,6 @@ bool TypeIsDisallowedClass(QualType T);
 bool TypeIsCallbackFunctionPointer(QualType T);
 
 bool MethodIsDisallowed(ASTContext &Context, CXXMethodDecl *MDecl);
-bool HasCallbackParameter(CXXMethodDecl *MDecl);
 
 std::string ReplaceLLDBNamespaceWithRPCNamespace(std::string Name);
 std::string StripLLDBNamespace(std::string Name);



More information about the lldb-commits mailing list