Skip to content

Commit 80e7cbe

Browse files
charles-zablitaugusto2112
authored andcommitted
fixup! use std::string instead of llvm::StringRef
1 parent 6c5bba1 commit 80e7cbe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,7 @@ GetDemangledBasename(const SymbolContext &sc) {
19501950
auto [demangled_name, info] = *info_or_err;
19511951

19521952
return demangled_name.substr(info.BasenameRange.first,
1953-
info.BasenameRange.second);
1953+
info.BasenameRange.second - info.BasenameRange.first);
19541954
}
19551955

19561956
static llvm::Expected<std::string>
@@ -1966,7 +1966,7 @@ GetDemangledFunctionPrefix(const SymbolContext &sc) {
19661966
"DemangledInfo for '%s does not have suffix range.",
19671967
demangled_name.data());
19681968

1969-
return demangled_name.substr(info.PrefixRange.first, info.PrefixRange.second);
1969+
return demangled_name.substr(info.PrefixRange.first, info.PrefixRange.second - info.PrefixRange.first);
19701970
}
19711971

19721972
static llvm::Expected<std::string>
@@ -1982,7 +1982,7 @@ GetDemangledFunctionSuffix(const SymbolContext &sc) {
19821982
"DemangledInfo for '%s does not have suffix range.",
19831983
demangled_name.data());
19841984

1985-
return demangled_name.substr(info.SuffixRange.first, info.SuffixRange.second);
1985+
return demangled_name.substr(info.SuffixRange.first, info.SuffixRange.second - info.SuffixRange.first);
19861986
}
19871987

19881988
static bool PrintDemangledArgumentList(Stream &s, const SymbolContext &sc) {
@@ -2001,7 +2001,7 @@ static bool PrintDemangledArgumentList(Stream &s, const SymbolContext &sc) {
20012001
return false;
20022002

20032003
s << demangled_name.substr(info.ArgumentsRange.first,
2004-
info.ArgumentsRange.second);
2004+
info.ArgumentsRange.second - info.ArgumentsRange.first);
20052005

20062006
return true;
20072007
}

0 commit comments

Comments
 (0)