@@ -1911,7 +1911,7 @@ SwiftLanguage::GetDemangledFunctionNameWithoutArguments(Mangled mangled) const {
19111911 return mangled_name;
19121912}
19131913
1914- static llvm::Expected<std::pair<llvm::StringRef , DemangledNameInfo>>
1914+ static llvm::Expected<std::pair<std::string , DemangledNameInfo>>
19151915GetAndValidateInfo (const SymbolContext &sc) {
19161916 Mangled mangled = sc.GetPossiblyInlinedFunctionName ();
19171917 if (!mangled)
@@ -1941,19 +1941,19 @@ GetAndValidateInfo(const SymbolContext &sc) {
19411941 return std::make_pair (demangled_name, info);
19421942}
19431943
1944- static llvm::Expected<llvm::StringRef >
1944+ static llvm::Expected<std::string >
19451945GetDemangledBasename (const SymbolContext &sc) {
19461946 auto info_or_err = GetAndValidateInfo (sc);
19471947 if (!info_or_err)
19481948 return info_or_err.takeError ();
19491949
19501950 auto [demangled_name, info] = *info_or_err;
19511951
1952- return demangled_name.slice (info.BasenameRange .first ,
1953- info.BasenameRange .second );
1952+ return demangled_name.substr (info.BasenameRange .first ,
1953+ info.BasenameRange .second );
19541954}
19551955
1956- static llvm::Expected<llvm::StringRef >
1956+ static llvm::Expected<std::string >
19571957GetDemangledFunctionPrefix (const SymbolContext &sc) {
19581958 auto info_or_err = GetAndValidateInfo (sc);
19591959 if (!info_or_err)
@@ -1966,10 +1966,10 @@ GetDemangledFunctionPrefix(const SymbolContext &sc) {
19661966 " DemangledInfo for '%s does not have suffix range." ,
19671967 demangled_name.data ());
19681968
1969- return demangled_name.slice (info.PrefixRange .first , info.PrefixRange .second );
1969+ return demangled_name.substr (info.PrefixRange .first , info.PrefixRange .second );
19701970}
19711971
1972- static llvm::Expected<llvm::StringRef >
1972+ static llvm::Expected<std::string >
19731973GetDemangledFunctionSuffix (const SymbolContext &sc) {
19741974 auto info_or_err = GetAndValidateInfo (sc);
19751975 if (!info_or_err)
@@ -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.slice (info.SuffixRange .first , info.SuffixRange .second );
1985+ return demangled_name.substr (info.SuffixRange .first , info.SuffixRange .second );
19861986}
19871987
19881988static bool PrintDemangledArgumentList (Stream &s, const SymbolContext &sc) {
@@ -2000,8 +2000,8 @@ static bool PrintDemangledArgumentList(Stream &s, const SymbolContext &sc) {
20002000 if (!info.hasArguments ())
20012001 return false ;
20022002
2003- s << demangled_name.slice (info.ArgumentsRange .first ,
2004- info.ArgumentsRange .second );
2003+ s << demangled_name.substr (info.ArgumentsRange .first ,
2004+ info.ArgumentsRange .second );
20052005
20062006 return true ;
20072007}
0 commit comments