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 @@ -708,8 +708,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; @@ -1186,8 +1186,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);