[Lldb-commits] [PATCH] D152315: [lldb][NFCI] Refactor TypeSystemClang::GetBasicTypeEnumeration
Adrian Prantl via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 6 16:17:49 PDT 2023
aprantl added inline comments.
================
Comment at: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:868
+lldb::BasicType TypeSystemClang::GetBasicTypeEnumeration(llvm::StringRef name) {
+ if (name.empty())
+ return eBasicTypeInvalid;
----------------
bulbazord wrote:
> aprantl wrote:
> > Isn't this redundant?
> Technically yes. My reasoning is that it's faster to see if a StringRef is empty than to perform a lookup in a hash map.
True, but this adds extra code to the binary that in practice will (presumably?) never get executed. Or are we often looking up empty types? (It's not a big deal either way, but since we are being pedantic :-)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152315/new/
https://reviews.llvm.org/D152315
More information about the lldb-commits
mailing list