https://github.com/bulbazord created 
https://github.com/llvm/llvm-project/pull/206834

None

>From 3d3d5e1ce9a3b86d9dea7fedc9f4497ca6019f54 Mon Sep 17 00:00:00 2001
From: Alex Langford <[email protected]>
Date: Tue, 30 Jun 2026 13:51:12 -0700
Subject: [PATCH] [lldb][NFC] Target::RemoveNameFromBreakpoint should take a
 StringRef

---
 lldb/include/lldb/Breakpoint/Breakpoint.h        | 4 ++--
 lldb/include/lldb/Target/Target.h                | 3 ++-
 lldb/source/API/SBBreakpoint.cpp                 | 4 ++--
 lldb/source/Commands/CommandObjectBreakpoint.cpp | 2 +-
 lldb/source/Target/Target.cpp                    | 4 ++--
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/lldb/include/lldb/Breakpoint/Breakpoint.h 
b/lldb/include/lldb/Breakpoint/Breakpoint.h
index c5baf3b87ee8e..14d3b17d272c7 100644
--- a/lldb/include/lldb/Breakpoint/Breakpoint.h
+++ b/lldb/include/lldb/Breakpoint/Breakpoint.h
@@ -560,8 +560,8 @@ class Breakpoint : public 
std::enable_shared_from_this<Breakpoint>,
 private:
   void AddName(llvm::StringRef new_name);
 
-  void RemoveName(const char *name_to_remove) {
-    if (name_to_remove)
+  void RemoveName(llvm::StringRef name_to_remove) {
+    if (!name_to_remove.empty())
       m_name_list.erase(name_to_remove);
   }
 
diff --git a/lldb/include/lldb/Target/Target.h 
b/lldb/include/lldb/Target/Target.h
index 75dec7d0723a2..239b0d27f400d 100644
--- a/lldb/include/lldb/Target/Target.h
+++ b/lldb/include/lldb/Target/Target.h
@@ -961,7 +961,8 @@ class Target : public std::enable_shared_from_this<Target>,
   void AddNameToBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name,
                            Status &error);
 
-  void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp, ConstString name);
+  void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp,
+                                llvm::StringRef name);
 
   BreakpointName *FindBreakpointName(ConstString name, bool can_create,
                                      Status &error);
diff --git a/lldb/source/API/SBBreakpoint.cpp b/lldb/source/API/SBBreakpoint.cpp
index 04af7a3aecdac..bcef2bd366f73 100644
--- a/lldb/source/API/SBBreakpoint.cpp
+++ b/lldb/source/API/SBBreakpoint.cpp
@@ -702,8 +702,8 @@ void SBBreakpoint::RemoveName(const char *name_to_remove) {
   if (bkpt_sp) {
     std::lock_guard<std::recursive_mutex> guard(
         bkpt_sp->GetTarget().GetAPIMutex());
-    bkpt_sp->GetTarget().RemoveNameFromBreakpoint(bkpt_sp,
-                                                  ConstString(name_to_remove));
+    bkpt_sp->GetTarget().RemoveNameFromBreakpoint(
+        bkpt_sp, llvm::StringRef(name_to_remove));
   }
 }
 
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp 
b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 38b79d6c33922..a100627ac33a6 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -3109,7 +3109,7 @@ class CommandObjectBreakpointNameDelete : public 
CommandObjectParsed {
         result.AppendError("no breakpoints specified, cannot delete names");
         return;
       }
-      ConstString bp_name(m_name_options.m_name.GetCurrentValue());
+      llvm::StringRef bp_name(m_name_options.m_name.GetCurrentValueAsRef());
       size_t num_valid_ids = valid_bp_ids.GetSize();
       for (size_t index = 0; index < num_valid_ids; index++) {
         lldb::break_id_t bp_id =
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 81ffb037ba673..cf96616e2c8f5 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -917,8 +917,8 @@ void Target::DeleteBreakpointName(ConstString name) {
 }
 
 void Target::RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp,
-                                      ConstString name) {
-  bp_sp->RemoveName(name.AsCString(nullptr));
+                                      llvm::StringRef name) {
+  bp_sp->RemoveName(name);
 }
 
 void Target::ConfigureBreakpointName(

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to