[lld] 1cd0752 - [ELF] Rename unique_saver to uniqueSaver. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 15 16:21:03 PDT 2024
Author: Fangrui Song
Date: 2024-09-15T16:20:58-07:00
New Revision: 1cd07526b4becdcaa8dc7db0757e85d39a8a4705
URL: https://github.com/llvm/llvm-project/commit/1cd07526b4becdcaa8dc7db0757e85d39a8a4705
DIFF: https://github.com/llvm/llvm-project/commit/1cd07526b4becdcaa8dc7db0757e85d39a8a4705.diff
LOG: [ELF] Rename unique_saver to uniqueSaver. NFC
and remove an unneeded FIXME.
Added:
Modified:
lld/ELF/InputFiles.cpp
lld/include/lld/Common/CommonLinkerContext.h
Removed:
################################################################################
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index db520178f3f534..76b04184854bb6 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -1746,11 +1746,11 @@ createBitcodeSymbol(Symbol *&sym, const std::vector<bool> &keptComdats,
if (!sym) {
// Symbols can be duplicated in bitcode files because of '#include' and
- // linkonce_odr. Use unique_saver to save symbol names for de-duplication.
+ // linkonce_odr. Use uniqueSaver to save symbol names for de-duplication.
// Update objSym.Name to reference (via StringRef) the string saver's copy;
// this way LTO can reference the same string saver's copy rather than
// keeping copies of its own.
- objSym.Name = unique_saver().save(objSym.getName());
+ objSym.Name = uniqueSaver().save(objSym.getName());
sym = symtab.insert(objSym.getName());
}
@@ -1804,11 +1804,11 @@ void BitcodeFile::parseLazy() {
symbols = std::make_unique<Symbol *[]>(numSymbols);
for (auto [i, irSym] : llvm::enumerate(obj->symbols())) {
// Symbols can be duplicated in bitcode files because of '#include' and
- // linkonce_odr. Use unique_saver to save symbol names for de-duplication.
+ // linkonce_odr. Use uniqueSaver to save symbol names for de-duplication.
// Update objSym.Name to reference (via StringRef) the string saver's copy;
// this way LTO can reference the same string saver's copy rather than
// keeping copies of its own.
- irSym.Name = unique_saver().save(irSym.getName());
+ irSym.Name = uniqueSaver().save(irSym.getName());
if (!irSym.isUndefined()) {
auto *sym = symtab.insert(irSym.getName());
sym->resolve(LazySymbol{*this});
diff --git a/lld/include/lld/Common/CommonLinkerContext.h b/lld/include/lld/Common/CommonLinkerContext.h
index 9970dfcb713f8d..3641bb70306c74 100644
--- a/lld/include/lld/Common/CommonLinkerContext.h
+++ b/lld/include/lld/Common/CommonLinkerContext.h
@@ -38,7 +38,7 @@ class CommonLinkerContext {
llvm::BumpPtrAllocator bAlloc;
llvm::StringSaver saver{bAlloc};
- llvm::UniqueStringSaver unique_saver{bAlloc};
+ llvm::UniqueStringSaver uniqueSaver{bAlloc};
llvm::DenseMap<void *, SpecificAllocBase *> instances;
ErrorHandler e;
@@ -57,11 +57,7 @@ bool hasContext();
inline llvm::BumpPtrAllocator &bAlloc() { return context().bAlloc; }
inline llvm::StringSaver &saver() { return context().saver; }
-inline llvm::UniqueStringSaver &unique_saver() {
- // FIXME: Look into other places where duplications are common in saved
- // strings and unique saver make sense.
- return context().unique_saver;
-}
+inline llvm::UniqueStringSaver &uniqueSaver() { return context().uniqueSaver; }
} // namespace lld
#endif
More information about the llvm-commits
mailing list