Skip to content

[lldb] Change Breakpoint::AddName return value #71236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

bulbazord
Copy link
Member

The return value is completely unused. Let's just return nothing.

The return value is completely unused. Let's just return nothing.
@llvmbot
Copy link
Member

llvmbot commented Nov 3, 2023

@llvm/pr-subscribers-lldb

Author: Alex Langford (bulbazord)

Changes

The return value is completely unused. Let's just return nothing.


Full diff: https://github.com/llvm/llvm-project/pull/71236.diff

2 Files Affected:

  • (modified) lldb/include/lldb/Breakpoint/Breakpoint.h (+1-1)
  • (modified) lldb/source/Breakpoint/Breakpoint.cpp (+1-2)
diff --git a/lldb/include/lldb/Breakpoint/Breakpoint.h b/lldb/include/lldb/Breakpoint/Breakpoint.h
index f2380157f111dd6..1daaee6c043fc56 100644
--- a/lldb/include/lldb/Breakpoint/Breakpoint.h
+++ b/lldb/include/lldb/Breakpoint/Breakpoint.h
@@ -525,7 +525,7 @@ class Breakpoint : public std::enable_shared_from_this<Breakpoint>,
 
 private: // The target needs to manage adding & removing names.  It will do the
          // checking for name validity as well.
-  bool AddName(llvm::StringRef new_name);
+  void AddName(llvm::StringRef new_name);
 
   void RemoveName(const char *name_to_remove) {
     if (name_to_remove)
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp
index ff4f195ea30909e..a94498a23a0fb27 100644
--- a/lldb/source/Breakpoint/Breakpoint.cpp
+++ b/lldb/source/Breakpoint/Breakpoint.cpp
@@ -841,9 +841,8 @@ bool Breakpoint::HasResolvedLocations() const {
 
 size_t Breakpoint::GetNumLocations() const { return m_locations.GetSize(); }
 
-bool Breakpoint::AddName(llvm::StringRef new_name) {
+void Breakpoint::AddName(llvm::StringRef new_name) {
   m_name_list.insert(new_name.str());
-  return true;
 }
 
 void Breakpoint::GetDescription(Stream *s, lldb::DescriptionLevel level,

Copy link
Member

@Michael137 Michael137 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jimingham
Copy link
Collaborator

That makes the comment directly above your change invalid.

@jimingham
Copy link
Collaborator

With this change it could no longer check name validity (wasn't anyway, but...)

@jimingham
Copy link
Collaborator

Probably should change that to "callers are required to check name validity?" Either that or move whoever is doing the checking here if you want to centralize that.

@bulbazord
Copy link
Member Author

I'll just remove the comment. If we want to make this do error checking, we'll have to shuffle around even more code than this change does right now. I wanted to mostly get rid of this piece of cognitive overhead (why does this return something and why do we drop it on the floor?)

@bulbazord
Copy link
Member Author

@jimingham Does this work for you?

@bulbazord bulbazord merged commit fe98cce into llvm:main Nov 9, 2023
@bulbazord bulbazord deleted the breakpoint-addname branch November 9, 2023 21:35
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
The return value is completely unused. Let's just return nothing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants