summaryrefslogtreecommitdiff
path: root/lldb/source/Symbol/Variable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Symbol/Variable.cpp')
-rw-r--r--lldb/source/Symbol/Variable.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/lldb/source/Symbol/Variable.cpp b/lldb/source/Symbol/Variable.cpp
index a0496824a0a34..6c18ef15e1a2d 100644
--- a/lldb/source/Symbol/Variable.cpp
+++ b/lldb/source/Symbol/Variable.cpp
@@ -1,4 +1,4 @@
-//===-- Variable.cpp --------------------------------------------*- C++ -*-===//
+//===-- Variable.cpp ------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -68,7 +68,7 @@ lldb::LanguageType Variable::GetLanguage() const {
}
ConstString Variable::GetName() const {
- ConstString name = m_mangled.GetName(GetLanguage());
+ ConstString name = m_mangled.GetName();
if (name)
return name;
return m_name;
@@ -82,16 +82,13 @@ bool Variable::NameMatches(ConstString name) const {
SymbolContext variable_sc;
m_owner_scope->CalculateSymbolContext(&variable_sc);
- LanguageType language = eLanguageTypeUnknown;
- if (variable_sc.comp_unit)
- language = variable_sc.comp_unit->GetLanguage();
- return m_mangled.NameMatches(name, language);
+ return m_mangled.NameMatches(name);
}
bool Variable::NameMatches(const RegularExpression &regex) const {
if (regex.Execute(m_name.AsCString()))
return true;
if (m_mangled)
- return m_mangled.NameMatches(regex, GetLanguage());
+ return m_mangled.NameMatches(regex);
return false;
}
@@ -532,7 +529,7 @@ static void PrivateAutoCompleteMembers(
i, member_name, nullptr, nullptr, nullptr);
if (partial_member_name.empty() ||
- member_name.find(partial_member_name) == 0) {
+ llvm::StringRef(member_name).startswith(partial_member_name)) {
if (member_name == partial_member_name) {
PrivateAutoComplete(
frame, partial_path,
@@ -684,8 +681,8 @@ static void PrivateAutoComplete(
break;
}
- std::string token(partial_path, 0, pos);
- remaining_partial_path = partial_path.substr(pos);
+ std::string token(std::string(partial_path), 0, pos);
+ remaining_partial_path = std::string(partial_path.substr(pos));
if (compiler_type.IsValid()) {
PrivateAutoCompleteMembers(frame, token, remaining_partial_path,