[Lldb-commits] [PATCH] D151603: [lldb][NFCI] Refactor Language::GetFormatterPrefixSuffix

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 26 18:36:27 PDT 2023


bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, jingham, mib, aprantl, Michael137, kastiglione.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

- Remove unused parameter `valobj` (I checked downstream, not even swift is using it).
- Return a std::pair<StringRef, StringRef> insted of having 2 out parameter strings.
- Remove the use of ConstStrings.

This change was primarily mechanical except in
`ObjCLanguage::GetFormatterPrefixSuffix`. To keep this fast, we
construct an llvm::StringMap<std::pair<StringRef, StringRef>> so that we
can look things up quickly. There is some amount of cost to setting up
the map the first time it is called, but subsequent lookups should be
as fast as a hash + string comparison (the cost of looking up something
in an llvm::StringMap).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151603

Files:
  lldb/include/lldb/Target/Language.h
  lldb/source/Plugins/Language/ObjC/CF.cpp
  lldb/source/Plugins/Language/ObjC/Cocoa.cpp
  lldb/source/Plugins/Language/ObjC/NSArray.cpp
  lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
  lldb/source/Plugins/Language/ObjC/NSSet.cpp
  lldb/source/Plugins/Language/ObjC/NSString.cpp
  lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
  lldb/source/Plugins/Language/ObjC/ObjCLanguage.h
  lldb/source/Target/Language.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151603.526231.patch
Type: text/x-patch
Size: 25372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230527/3bd7ac3f/attachment-0001.bin>


More information about the lldb-commits mailing list