Skip to content

Commit 1cd0752

Browse files
committed
[ELF] Rename unique_saver to uniqueSaver. NFC
and remove an unneeded FIXME.
1 parent 81279bf commit 1cd0752

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

lld/ELF/InputFiles.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,11 +1746,11 @@ createBitcodeSymbol(Symbol *&sym, const std::vector<bool> &keptComdats,
17461746

17471747
if (!sym) {
17481748
// Symbols can be duplicated in bitcode files because of '#include' and
1749-
// linkonce_odr. Use unique_saver to save symbol names for de-duplication.
1749+
// linkonce_odr. Use uniqueSaver to save symbol names for de-duplication.
17501750
// Update objSym.Name to reference (via StringRef) the string saver's copy;
17511751
// this way LTO can reference the same string saver's copy rather than
17521752
// keeping copies of its own.
1753-
objSym.Name = unique_saver().save(objSym.getName());
1753+
objSym.Name = uniqueSaver().save(objSym.getName());
17541754
sym = symtab.insert(objSym.getName());
17551755
}
17561756

@@ -1804,11 +1804,11 @@ void BitcodeFile::parseLazy() {
18041804
symbols = std::make_unique<Symbol *[]>(numSymbols);
18051805
for (auto [i, irSym] : llvm::enumerate(obj->symbols())) {
18061806
// Symbols can be duplicated in bitcode files because of '#include' and
1807-
// linkonce_odr. Use unique_saver to save symbol names for de-duplication.
1807+
// linkonce_odr. Use uniqueSaver to save symbol names for de-duplication.
18081808
// Update objSym.Name to reference (via StringRef) the string saver's copy;
18091809
// this way LTO can reference the same string saver's copy rather than
18101810
// keeping copies of its own.
1811-
irSym.Name = unique_saver().save(irSym.getName());
1811+
irSym.Name = uniqueSaver().save(irSym.getName());
18121812
if (!irSym.isUndefined()) {
18131813
auto *sym = symtab.insert(irSym.getName());
18141814
sym->resolve(LazySymbol{*this});

lld/include/lld/Common/CommonLinkerContext.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CommonLinkerContext {
3838

3939
llvm::BumpPtrAllocator bAlloc;
4040
llvm::StringSaver saver{bAlloc};
41-
llvm::UniqueStringSaver unique_saver{bAlloc};
41+
llvm::UniqueStringSaver uniqueSaver{bAlloc};
4242
llvm::DenseMap<void *, SpecificAllocBase *> instances;
4343

4444
ErrorHandler e;
@@ -57,11 +57,7 @@ bool hasContext();
5757

5858
inline llvm::BumpPtrAllocator &bAlloc() { return context().bAlloc; }
5959
inline llvm::StringSaver &saver() { return context().saver; }
60-
inline llvm::UniqueStringSaver &unique_saver() {
61-
// FIXME: Look into other places where duplications are common in saved
62-
// strings and unique saver make sense.
63-
return context().unique_saver;
64-
}
60+
inline llvm::UniqueStringSaver &uniqueSaver() { return context().uniqueSaver; }
6561
} // namespace lld
6662

6763
#endif

0 commit comments

Comments
 (0)