[Lldb-commits] [PATCH] D58720: Remove unnecessary demangling operation (hopefully NFC)
Adrian Prantl via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 27 08:23:29 PST 2019
aprantl created this revision.
aprantl added reviewers: sgraenitz, jingham.
Herald added a subscriber: erik.pilkington.
Herald added a project: LLDB.
This extra call to the demangler doesn't affect the performance of C++ because the result is being cached anyway; but I'm working on a patch to the Swift branch that uses extra contextual information to provide a more accurate demangling result. In that case this call would be extra and unnecessary work.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D58720
Files:
lldb/source/Core/Mangled.cpp
Index: lldb/source/Core/Mangled.cpp
===================================================================
--- lldb/source/Core/Mangled.cpp
+++ lldb/source/Core/Mangled.cpp
@@ -490,13 +490,11 @@
lldb::LanguageType Mangled::GuessLanguage() const {
ConstString mangled = GetMangledName();
if (mangled) {
- if (GetDemangledName(lldb::eLanguageTypeUnknown)) {
- const char *mangled_name = mangled.GetCString();
- if (CPlusPlusLanguage::IsCPPMangledName(mangled_name))
- return lldb::eLanguageTypeC_plus_plus;
- else if (ObjCLanguage::IsPossibleObjCMethodName(mangled_name))
- return lldb::eLanguageTypeObjC;
- }
+ const char *mangled_name = mangled.GetCString();
+ if (CPlusPlusLanguage::IsCPPMangledName(mangled_name))
+ return lldb::eLanguageTypeC_plus_plus;
+ else if (ObjCLanguage::IsPossibleObjCMethodName(mangled_name))
+ return lldb::eLanguageTypeObjC;
} else {
// ObjC names aren't really mangled, so they won't necessarily be in the
// mangled name slot.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58720.188549.patch
Type: text/x-patch
Size: 1031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190227/c89b5a7d/attachment.bin>
More information about the lldb-commits
mailing list