diff options
| author | Stefan Granitz <stefan.graenitz@gmail.com> | 2018-08-06 14:15:17 +0000 |
|---|---|---|
| committer | Stefan Granitz <stefan.graenitz@gmail.com> | 2018-08-06 14:15:17 +0000 |
| commit | 4af5a83a488309cab169f0651675e5d7cafc669f (patch) | |
| tree | 556a6cc63d02c7c9cbe4ba8a21bae1a3cea7535c /lldb/source/Core | |
| parent | e0237064710fb672ffccc6f02d0729cc0ef6062e (diff) | |
| download | bcm5719-llvm-4af5a83a488309cab169f0651675e5d7cafc669f.tar.gz bcm5719-llvm-4af5a83a488309cab169f0651675e5d7cafc669f.zip | |
Add ConstString::IsNull() to tell between null vs. empty strings and fix usage in Mangled::GetDemangledName()
Summary: `IsEmpty()` and `operator bool() == false` have equal semantics. Usage in Mangled::GetDemangledName() was incorrect. What it actually wants is a check for null-string. Split this off of D50071 and added a test to clarify usage.
Reviewers: labath, jingham
Subscribers: erik.pilkington, lldb-commits
Differential Revision: https://reviews.llvm.org/D50327
llvm-svn: 339014
Diffstat (limited to 'lldb/source/Core')
| -rw-r--r-- | lldb/source/Core/Mangled.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp index 043afe735fd..a6a5f8d3660 100644 --- a/lldb/source/Core/Mangled.cpp +++ b/lldb/source/Core/Mangled.cpp @@ -242,7 +242,7 @@ const ConstString & Mangled::GetDemangledName(lldb::LanguageType language) const { // Check to make sure we have a valid mangled name and that we haven't // already decoded our mangled name. - if (m_mangled && !m_demangled) { + if (m_mangled && m_demangled.IsNull()) { // We need to generate and cache the demangled name. static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); Timer scoped_timer(func_cat, "Mangled::GetDemangledName (m_mangled = %s)", @@ -312,7 +312,7 @@ Mangled::GetDemangledName(lldb::LanguageType language) const { free(demangled_name); } } - if (!m_demangled) { + if (m_demangled.IsNull()) { // Set the demangled string to the empty string to indicate we tried to // parse it once and failed. m_demangled.SetCString(""); |

