@@ -222,7 +222,7 @@ std::optional<MemoryBufferRef> elf::readFile(Ctx &ctx, StringRef path) {
222222 // The --chroot option changes our virtual root directory.
223223 // This is useful when you are dealing with files created by --reproduce.
224224 if (!ctx.arg .chroot .empty () && path.starts_with (" /" ))
225- path = saver ( ctx) .save (ctx.arg .chroot + path);
225+ path = ctx. saver .save (ctx.arg .chroot + path);
226226
227227 bool remapped = false ;
228228 auto it = ctx.arg .remapInputs .find (path);
@@ -427,9 +427,9 @@ static void addDependentLibrary(Ctx &ctx, StringRef specifier,
427427 if (!ctx.arg .dependentLibraries )
428428 return ;
429429 if (std::optional<std::string> s = searchLibraryBaseName (ctx, specifier))
430- ctx.driver .addFile (saver ( ctx) .save (*s), /* withLOption=*/ true );
430+ ctx.driver .addFile (ctx. saver .save (*s), /* withLOption=*/ true );
431431 else if (std::optional<std::string> s = findFromSearchPaths (ctx, specifier))
432- ctx.driver .addFile (saver ( ctx) .save (*s), /* withLOption=*/ true );
432+ ctx.driver .addFile (ctx. saver .save (*s), /* withLOption=*/ true );
433433 else if (fs::exists (specifier))
434434 ctx.driver .addFile (specifier, /* withLOption=*/ false );
435435 else
@@ -1512,7 +1512,7 @@ template <class ELFT> void SharedFile::parse() {
15121512 }
15131513
15141514 // DSOs are uniquified not by filename but by soname.
1515- StringSaver &ss = saver ( ctx) ;
1515+ StringSaver &ss = ctx. saver ;
15161516 DenseMap<CachedHashStringRef, SharedFile *>::iterator it;
15171517 bool wasInserted;
15181518 std::tie (it, wasInserted) =
@@ -1720,7 +1720,7 @@ BitcodeFile::BitcodeFile(Ctx &ctx, MemoryBufferRef mb, StringRef archiveName,
17201720 // into consideration at LTO time (which very likely causes undefined
17211721 // symbols later in the link stage). So we append file offset to make
17221722 // filename unique.
1723- StringSaver &ss = saver ( ctx) ;
1723+ StringSaver &ss = ctx. saver ;
17241724 StringRef name = archiveName.empty ()
17251725 ? ss.save (path)
17261726 : ss.save (archiveName + " (" + path::filename (path) +
@@ -1761,7 +1761,7 @@ static void createBitcodeSymbol(Ctx &ctx, Symbol *&sym,
17611761 // Update objSym.Name to reference (via StringRef) the string saver's copy;
17621762 // this way LTO can reference the same string saver's copy rather than
17631763 // keeping copies of its own.
1764- objSym.Name = uniqueSaver ( ctx) .save (objSym.getName ());
1764+ objSym.Name = ctx. uniqueSaver .save (objSym.getName ());
17651765 sym = ctx.symtab ->insert (objSym.getName ());
17661766 }
17671767
@@ -1814,14 +1814,13 @@ void BitcodeFile::parse() {
18141814void BitcodeFile::parseLazy () {
18151815 numSymbols = obj->symbols ().size ();
18161816 symbols = std::make_unique<Symbol *[]>(numSymbols);
1817- auto &ss = uniqueSaver (ctx);
18181817 for (auto [i, irSym] : llvm::enumerate (obj->symbols ())) {
18191818 // Symbols can be duplicated in bitcode files because of '#include' and
18201819 // linkonce_odr. Use uniqueSaver to save symbol names for de-duplication.
18211820 // Update objSym.Name to reference (via StringRef) the string saver's copy;
18221821 // this way LTO can reference the same string saver's copy rather than
18231822 // keeping copies of its own.
1824- irSym.Name = ss .save (irSym.getName ());
1823+ irSym.Name = ctx. uniqueSaver .save (irSym.getName ());
18251824 if (!irSym.isUndefined ()) {
18261825 auto *sym = ctx.symtab ->insert (irSym.getName ());
18271826 sym->resolve (ctx, LazySymbol{*this });
@@ -1858,7 +1857,7 @@ void BinaryFile::parse() {
18581857 if (!isAlnum (c))
18591858 c = ' _' ;
18601859
1861- llvm::StringSaver &ss = saver ( ctx) ;
1860+ llvm::StringSaver &ss = ctx. saver ;
18621861 ctx.symtab ->addAndCheckDuplicate (
18631862 ctx, Defined{ctx, this , ss.save (s + " _start" ), STB_GLOBAL, STV_DEFAULT,
18641863 STT_OBJECT, 0 , 0 , section});
0 commit comments