[Lldb-commits] [PATCH] D107485: [nfc] [lldb] Prevent needless copies of DataExtractor

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 4 10:51:38 PDT 2021


jankratochvil created this revision.
jankratochvil added reviewers: clayborg, labath, teemperor.
jankratochvil added a project: LLDB.
Herald added a subscriber: JDevlieghere.
jankratochvil requested review of this revision.

This patch was created accidentally but I find it useful when I already wrote it.
`lldb_private::DataExtractor` contains `DataBufferSP m_data_sp` which is relatively expensive to copy (due to multi-threading locking).
`llvm::DataExtractor` does not have this problem as it uses `StringRef` instead.
The copy constructor is explicit as otherwise it is easy to make unintended modification of a local copy instead of a caller's instance (D107470 <https://reviews.llvm.org/D107470> but that is `llvm::DataExtractor`).
OK to check it in?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107485

Files:
  lldb/include/lldb/DataFormatters/StringPrinter.h
  lldb/include/lldb/Utility/DataExtractor.h
  lldb/source/DataFormatters/StringPrinter.cpp
  lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
  lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
  lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
  lldb/source/Plugins/Process/elf-core/RegisterUtilities.cpp
  lldb/unittests/DataFormatter/StringPrinterTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107485.364185.patch
Type: text/x-patch
Size: 8587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210804/2b964b9f/attachment.bin>


More information about the lldb-commits mailing list