diff options
| author | Adrian Prantl <aprantl@apple.com> | 2019-02-27 22:54:47 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2019-02-27 22:54:47 +0000 |
| commit | 7feefe866463cb8937d0b82a3aa63bc1129d52aa (patch) | |
| tree | c471ce0ee772d7cd950d2bb2e198f8fece244186 /lldb/source/Core | |
| parent | f6b0a14bff33f85087e9cc5c3b1bb00f58ed8b8b (diff) | |
| download | bcm5719-llvm-7feefe866463cb8937d0b82a3aa63bc1129d52aa.tar.gz bcm5719-llvm-7feefe866463cb8937d0b82a3aa63bc1129d52aa.zip | |
Remove unnecessary demangling operation (NFC)
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.
Differential Revision: https://reviews.llvm.org/D58720
llvm-svn: 355042
Diffstat (limited to 'lldb/source/Core')
| -rw-r--r-- | lldb/source/Core/Mangled.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp index f366ad6e3de..5ab3fdf949d 100644 --- a/lldb/source/Core/Mangled.cpp +++ b/lldb/source/Core/Mangled.cpp @@ -490,13 +490,11 @@ size_t Mangled::MemorySize() const { 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. |

