[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:
Jonas Devlieghere committed 2020-09-25 11:47:05 -07:00
1 parent 89fe083c19
commit 6cd4a4cd02
10 files changed
+19 -27

No files matched your search

+2 -2
View File
@@ -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);
}
}