From f9408c33f2f0816d91701c71e26a3650d299356a Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 17 Dec 2015 01:00:50 +0000 Subject: [PATCH] Don't demangle a name when Mangled::GetName() is called with ePreferMangled. Only demangle if this isn't the the value for the "preference" argument indicating the user wants the demangled name. This will stop a lot of symbols from being demangled when parsing the symbol table in ObjectFileMachO. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@255864 91177308-0d34-0410-b5e6-96231b3b80d8 --- source/Core/Mangled.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/Core/Mangled.cpp b/source/Core/Mangled.cpp index cf351ba920..bdc710c8f8 100644 --- a/source/Core/Mangled.cpp +++ b/source/Core/Mangled.cpp @@ -362,6 +362,9 @@ Mangled::NameMatches (const RegularExpression& regex, lldb::LanguageType languag ConstString Mangled::GetName (lldb::LanguageType language, Mangled::NamePreference preference) const { + if (preference == ePreferMangled && m_mangled) + return m_mangled; + ConstString demangled = GetDemangledName(language); if (preference == ePreferDemangledWithoutArguments) @@ -376,12 +379,7 @@ Mangled::GetName (lldb::LanguageType language, Mangled::NamePreference preferenc return demangled; return m_mangled; } - else - { - if (m_mangled) - return m_mangled; - return demangled; - } + return demangled; } //----------------------------------------------------------------------