Author: David Spickett Date: 2022-05-18T09:00:00Z New Revision: 7d8ec4dc4461102bafed8063977a66e40562bbb3
URL: https://github.com/llvm/llvm-project/commit/7d8ec4dc4461102bafed8063977a66e40562bbb3 DIFF: https://github.com/llvm/llvm-project/commit/7d8ec4dc4461102bafed8063977a66e40562bbb3.diff LOG: [lldb] const a couple of getters on MemoryRegionInfo GetDirtyPageList was being assigned to const & in most places anyway. If you wanted to change the list you'd make a new one and call SetDirtyPageList. GetPageSize is just an int so no issues being const. Differential Revision: https://reviews.llvm.org/D125786 Added: Modified: lldb/include/lldb/Target/MemoryRegionInfo.h lldb/source/API/SBMemoryRegionInfo.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/Target/MemoryRegionInfo.h b/lldb/include/lldb/Target/MemoryRegionInfo.h index fc5fcff5159ee..acca66e838337 100644 --- a/lldb/include/lldb/Target/MemoryRegionInfo.h +++ b/lldb/include/lldb/Target/MemoryRegionInfo.h @@ -107,13 +107,13 @@ class MemoryRegionInfo { /// Get the target system's VM page size in bytes. /// \return /// 0 is returned if this information is unavailable. - int GetPageSize() { return m_pagesize; } + int GetPageSize() const { return m_pagesize; } /// Get a vector of target VM pages that are dirty -- that have been /// modified -- within this memory region. This is an Optional return /// value; it will only be available if the remote stub was able to /// detail this. - llvm::Optional<std::vector<lldb::addr_t>> &GetDirtyPageList() { + const llvm::Optional<std::vector<lldb::addr_t>> &GetDirtyPageList() const { return m_dirty_pages; } diff --git a/lldb/source/API/SBMemoryRegionInfo.cpp b/lldb/source/API/SBMemoryRegionInfo.cpp index 7d9db478dde17..1a16622b55742 100644 --- a/lldb/source/API/SBMemoryRegionInfo.cpp +++ b/lldb/source/API/SBMemoryRegionInfo.cpp @@ -133,7 +133,7 @@ uint32_t SBMemoryRegionInfo::GetNumDirtyPages() { LLDB_INSTRUMENT_VA(this); uint32_t num_dirty_pages = 0; - llvm::Optional<std::vector<addr_t>> dirty_page_list = + const llvm::Optional<std::vector<addr_t>> &dirty_page_list = m_opaque_up->GetDirtyPageList(); if (dirty_page_list.hasValue()) num_dirty_pages = dirty_page_list.getValue().size(); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits