<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Breakpoint/BreakpointIDList.cpp, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[lldb] Fix else-after-return in Breakpoint (NFC)</title>
<updated>2025-07-02T19:07:20+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-07-02T17:37:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ab0fa6c5dc725ef6f839ac8cea9b3a41aa3a5b75'/>
<id>ab0fa6c5dc725ef6f839ac8cea9b3a41aa3a5b75</id>
<content type='text'>
The LLVM Coding Standards [1] discourages the use of 'else' or 'else if'
after something that interrupts control flow. Bulk fix all instances as
I'm working on this part of LLDB.

[1] https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The LLVM Coding Standards [1] discourages the use of 'else' or 'else if'
after something that interrupts control flow. Bulk fix all instances as
I'm working on this part of LLDB.

[1] https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Use const reference for range variables to improve performance (NFC) (#94840)</title>
<updated>2024-06-08T17:04:40+00:00</updated>
<author>
<name>Shivam Gupta</name>
<email>shivam98.tkg@gmail.com</email>
</author>
<published>2024-06-08T17:04:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1e92ad41d8ef46fa3c628b05ba8ed481fedc17bd'/>
<id>1e92ad41d8ef46fa3c628b05ba8ed481fedc17bd</id>
<content type='text'>
Cppcheck recommends using a const reference for range variables in a
for-each loop.
This avoids unnecessary copying of elements, improving performance.

Caught by cppcheck -
lldb/source/API/SBBreakpoint.cpp:717:22: performance: Range variable
'name' should be declared as const reference. [iterateByValue]
lldb/source/API/SBTarget.cpp:1150:15: performance: Range variable 'name'
should be declared as const reference. [iterateByValue]
lldb/source/Breakpoint/Breakpoint.cpp:888:26: performance: Range
variable 'name' should be declared as const reference. [iterateByValue]
lldb/source/Breakpoint/BreakpointIDList.cpp:262:26: performance: Range
variable 'name' should be declared as const reference. [iterateByValue]

Fix #91213
Fix #91217
Fix #91219
Fix #91220</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cppcheck recommends using a const reference for range variables in a
for-each loop.
This avoids unnecessary copying of elements, improving performance.

Caught by cppcheck -
lldb/source/API/SBBreakpoint.cpp:717:22: performance: Range variable
'name' should be declared as const reference. [iterateByValue]
lldb/source/API/SBTarget.cpp:1150:15: performance: Range variable 'name'
should be declared as const reference. [iterateByValue]
lldb/source/Breakpoint/Breakpoint.cpp:888:26: performance: Range
variable 'name' should be declared as const reference. [iterateByValue]
lldb/source/Breakpoint/BreakpointIDList.cpp:262:26: performance: Range
variable 'name' should be declared as const reference. [iterateByValue]

Fix #91213
Fix #91217
Fix #91219
Fix #91220</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Don't crash when attempting to parse breakpoint id `N.` as `N.*` (#87263)</title>
<updated>2024-04-01T21:02:12+00:00</updated>
<author>
<name>Jordan Rupprecht</name>
<email>rupprecht@google.com</email>
</author>
<published>2024-04-01T21:02:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a6caceed8d27d4ebd44c517c3114a36a64ebddfe'/>
<id>a6caceed8d27d4ebd44c517c3114a36a64ebddfe</id>
<content type='text'>
We check if the next character after `N.` is `*` before we check its
length. Using `split` on the string is cleaner and less error prone than
using indices with `find` and `substr`.

Note: this does not make `N.` mean anything, it just prevents assertion
failures. `N.` is treated the same as an unrecognized breakpoint name:

```
(lldb) breakpoint enable 1
1 breakpoints enabled.
(lldb) breakpoint enable 1.*
1 breakpoints enabled.
(lldb) breakpoint enable 1.
0 breakpoints enabled.
(lldb) breakpoint enable xyz
0 breakpoints enabled.
```

Found via LLDB fuzzers.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We check if the next character after `N.` is `*` before we check its
length. Using `split` on the string is cleaner and less error prone than
using indices with `find` and `substr`.

Note: this does not make `N.` mean anything, it just prevents assertion
failures. `N.` is treated the same as an unrecognized breakpoint name:

```
(lldb) breakpoint enable 1
1 breakpoints enabled.
(lldb) breakpoint enable 1.*
1 breakpoints enabled.
(lldb) breakpoint enable 1.
0 breakpoints enabled.
(lldb) breakpoint enable xyz
0 breakpoints enabled.
```

Found via LLDB fuzzers.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][NFCI] Change BreakpointIDList::FindBreakpointID to BreakpointIDList::Contains (#79517)</title>
<updated>2024-01-26T18:19:03+00:00</updated>
<author>
<name>Alex Langford</name>
<email>alangford@apple.com</email>
</author>
<published>2024-01-26T18:19:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5f22d3356cda0a9b1521c839c006f61b5cc504fc'/>
<id>5f22d3356cda0a9b1521c839c006f61b5cc504fc</id>
<content type='text'>
`FindBreakpointID` take a BreakpointID and a pointer to a size_t (so you
can get position information). It returns a bool to indicate whether the
id was found in the list or not.

There are 2 callers of this currently and neither one actually uses the
position information, so I removed it. After that, I renamed it to
Contains to more accurately reflect the intent. Additionally, I changed
the argument type from a reference to a value (because BreakpointID is
just a wrapper around 2 integers, copies are cheap).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`FindBreakpointID` take a BreakpointID and a pointer to a size_t (so you
can get position information). It returns a bool to indicate whether the
id was found in the list or not.

There are 2 callers of this currently and neither one actually uses the
position information, so I removed it. After that, I renamed it to
Contains to more accurately reflect the intent. Additionally, I changed
the argument type from a reference to a value (because BreakpointID is
just a wrapper around 2 integers, copies are cheap).</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][NFCI] Remove unused method BreakpointIDList::FindBreakpointID(const char *, size_t *) (#79215)</title>
<updated>2024-01-25T19:14:53+00:00</updated>
<author>
<name>Alex Langford</name>
<email>alangford@apple.com</email>
</author>
<published>2024-01-25T19:14:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=59a6525a4b9d46b931021f727b3235415bc82ea5'/>
<id>59a6525a4b9d46b931021f727b3235415bc82ea5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][NFCI] Remove unused method BreakpointIDList::AddBreakpointID(const char *) (#79189)</title>
<updated>2024-01-23T21:41:36+00:00</updated>
<author>
<name>Alex Langford</name>
<email>alangford@apple.com</email>
</author>
<published>2024-01-23T21:41:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6c98c5bd99b4c71a7895337cd4e437e023c2ec7a'/>
<id>6c98c5bd99b4c71a7895337cd4e437e023c2ec7a</id>
<content type='text'>
This overload is completely unused.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This overload is completely unused.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][NFCI] Remove CommandReturnObject from BreakpointIDList (#77858)</title>
<updated>2024-01-12T21:52:59+00:00</updated>
<author>
<name>Alex Langford</name>
<email>alangford@apple.com</email>
</author>
<published>2024-01-12T21:52:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c8ef88c446a3ff773c5be2fbf3df84b8b40c0c41'/>
<id>c8ef88c446a3ff773c5be2fbf3df84b8b40c0c41</id>
<content type='text'>
BreakpointIDList does not need to know about CommandReturnObject.
BreakpointIDList::FindAndReplaceIDRanges is the last place that uses it
in BreakpointIDList.

Instead of passing in a CommandReturnObject, it now returns an
llvm::Error. The callsite uses the Error to populate the
CommandReturnObject as needed.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BreakpointIDList does not need to know about CommandReturnObject.
BreakpointIDList::FindAndReplaceIDRanges is the last place that uses it
in BreakpointIDList.

Instead of passing in a CommandReturnObject, it now returns an
llvm::Error. The callsite uses the Error to populate the
CommandReturnObject as needed.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][NFCI] Change return type of BreakpointIDList::GetBreakpointIDAtIndex (#77166)</title>
<updated>2024-01-08T18:52:00+00:00</updated>
<author>
<name>Alex Langford</name>
<email>alangford@apple.com</email>
</author>
<published>2024-01-08T18:52:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5cbf74b012c10e9cc841a27cd5d7335e556f47dd'/>
<id>5cbf74b012c10e9cc841a27cd5d7335e556f47dd</id>
<content type='text'>
There are 2 motivations here:
1.) There is no need to hand out constant references to BreakpointIDs,
they are only 8 bytes big. In addition, every use of this method already
  makes a copy anyway.
2.) Each BreakpointIDList held onto an invalid BreakpointID specifically
to
  prevent lifetime issues. Returning a value means you can return an
  invalid BreakpointID instead of needing to allocate storage for an
  invalid BreakpointID.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are 2 motivations here:
1.) There is no need to hand out constant references to BreakpointIDs,
they are only 8 bytes big. In addition, every use of this method already
  makes a copy anyway.
2.) Each BreakpointIDList held onto an invalid BreakpointID specifically
to
  prevent lifetime issues. Returning a value means you can return an
  invalid BreakpointID instead of needing to allocate storage for an
  invalid BreakpointID.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][NFCI] Remove BreakpointIDList::InsertStringArray (#77161)</title>
<updated>2024-01-08T18:51:00+00:00</updated>
<author>
<name>Alex Langford</name>
<email>alangford@apple.com</email>
</author>
<published>2024-01-08T18:51:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=07d6fbf8d80083470b4371f2ddabd656a9c317e6'/>
<id>07d6fbf8d80083470b4371f2ddabd656a9c317e6</id>
<content type='text'>
This abstraction is leaky and BreakpointIDList does not need to know
about CommandReturnObject.
Additionally, setting the CommandReturnObject inout param to a success
state does very little. The function returns immediately if the input
ArrayRef is empty, and reading
CommandObjectMultiwordBreakpoint::VerifyIDs more closely, the input is
always empty if the previous call to
BreakpointIDList::FindAndReplaceIDRanges failed. If the call was
successful, then the CommandReturnObject is already in a success state.

I have opted to remove the function altogether and inline the
functionality where it was used.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This abstraction is leaky and BreakpointIDList does not need to know
about CommandReturnObject.
Additionally, setting the CommandReturnObject inout param to a success
state does very little. The function returns immediately if the input
ArrayRef is empty, and reading
CommandObjectMultiwordBreakpoint::VerifyIDs more closely, the input is
always empty if the previous call to
BreakpointIDList::FindAndReplaceIDRanges failed. If the call was
successful, then the CommandReturnObject is already in a success state.

I have opted to remove the function altogether and inline the
functionality where it was used.</pre>
</div>
</content>
</entry>
<entry>
<title>[lld] Don't use Optional::hasValue (NFC)</title>
<updated>2022-06-27T02:29:40+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2022-06-27T02:29:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=96d1b4ddb2cc37b900692215f7598ff5970b0baa'/>
<id>96d1b4ddb2cc37b900692215f7598ff5970b0baa</id>
<content type='text'>
This patch replaces x.hasValue() with x where x is contextually
convertible to bool.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces x.hasValue() with x where x is contextually
convertible to bool.
</pre>
</div>
</content>
</entry>
</feed>
