diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -707,8 +707,8 @@ return Sym.TypeChar != 'U' && Sym.TypeChar != 'w' && Sym.TypeChar != 'v'; } -static void writeFileName(raw_ostream &S, const std::string &ArchiveName, - const std::string &ArchitectureName) { +static void writeFileName(raw_ostream &S, StringRef ArchiveName, + StringRef ArchitectureName) { if (!ArchitectureName.empty()) S << "(for architecture " << ArchitectureName << "):"; if (OutputFormat == posix && !ArchiveName.empty()) @@ -721,8 +721,8 @@ } static void sortAndPrintSymbolList(SymbolicFile &Obj, bool printName, - const std::string &ArchiveName, - const std::string &ArchitectureName) { + StringRef ArchiveName, + StringRef ArchitectureName) { if (!NoSort) { using Comparator = bool (*)(const NMSymbol &, const NMSymbol &); Comparator Cmp; @@ -1181,8 +1181,8 @@ static void dumpSymbolNamesFromObject(SymbolicFile &Obj, bool printName, - const std::string &ArchiveName = std::string(), - const std::string &ArchitectureName = std::string()) { + StringRef ArchiveName = {}, + StringRef ArchitectureName = {}) { auto Symbols = Obj.symbols(); if (DynamicSyms) { const auto *E = dyn_cast(&Obj);