mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 15:14:31 +00:00
[lldb] Pass reference instead of pointer in protected SBAddress methods.
Every call to the protected SBAddress constructor and the SetAddress method takes the address of a valid object which means we might as well pass it as a const reference instead of a pointer and drop the null check. Differential revision: https://reviews.llvm.org/D88249
This commit is contained in:
1 parent
89fe083c19
commit
6cd4a4cd02
10 files changed
+19
-27
No files matched your search
@@ -152,7 +152,7 @@ SBAddress SBFunction::GetStartAddress() {
|
||||
|
||||
SBAddress addr;
|
||||
if (m_opaque_ptr)
|
||||
addr.SetAddress(&m_opaque_ptr->GetAddressRange().GetBaseAddress());
|
||||
addr.SetAddress(m_opaque_ptr->GetAddressRange().GetBaseAddress());
|
||||
return LLDB_RECORD_RESULT(addr);
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ SBAddress SBFunction::GetEndAddress() {
|
||||
if (m_opaque_ptr) {
|
||||
addr_t byte_size = m_opaque_ptr->GetAddressRange().GetByteSize();
|
||||
if (byte_size > 0) {
|
||||
addr.SetAddress(&m_opaque_ptr->GetAddressRange().GetBaseAddress());
|
||||
addr.SetAddress(m_opaque_ptr->GetAddressRange().GetBaseAddress());
|
||||
addr->Slide(byte_size);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user