[Lldb-commits] [PATCH] D152315: [lldb][NFCI] Refactor TypeSystemClang::GetBasicTypeEnumeration

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 6 15:42:52 PDT 2023


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

`TypeSystemClang::GetBasicTypeEnumeration(ConstString)` builds up a
giant `UniqueCStringMap<lldb::BasicType>` which is effectively a vector whose elements
are (ConstString, lldb::BasicType). Once sorted, we get to have fairly
quick lookups (O(log n) on average). This is fine, but we can do better
on average with an llvm::StringMap.

This also allows us to simplify the initialization code for the lookup,
no more `once_flag`!

Additionally, I removed unused declarations of related functions from
CompilerType and TypeSystemClang


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152315

Files:
  lldb/include/lldb/Symbol/CompilerType.h
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152315.529066.patch
Type: text/x-patch
Size: 6590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230606/9e656fce/attachment-0001.bin>


More information about the lldb-commits mailing list