[lld] d3e792c - [lld] Remove unused local variables (NFC) (#138470)

via llvm-commits llvm-commits at lists.llvm.org
Sun May 4 14:14:37 PDT 2025


Author: Kazu Hirata
Date: 2025-05-04T14:14:34-07:00
New Revision: d3e792cec1c29d2abd52983cc200cd1551ceb2cd

URL: https://github.com/llvm/llvm-project/commit/d3e792cec1c29d2abd52983cc200cd1551ceb2cd
DIFF: https://github.com/llvm/llvm-project/commit/d3e792cec1c29d2abd52983cc200cd1551ceb2cd.diff

LOG: [lld] Remove unused local variables (NFC) (#138470)

Added: 
    

Modified: 
    lld/COFF/DebugTypes.cpp
    lld/ELF/Driver.cpp
    lld/wasm/WriterUtils.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp
index 28e6993e3eeaa..c375360d19e70 100644
--- a/lld/COFF/DebugTypes.cpp
+++ b/lld/COFF/DebugTypes.cpp
@@ -475,7 +475,6 @@ static bool equalsPath(StringRef path1, StringRef path2) {
 
 // Find by name an OBJ provided on the command line
 PrecompSource *UsePrecompSource::findObjByName(StringRef fileNameOnly) {
-  SmallString<128> currentPath;
   for (auto kv : ctx.precompSourceMappings) {
     StringRef currentFileName = sys::path::filename(kv.second->file->getName(),
                                                     sys::path::Style::windows);

diff  --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 9d36071e1532f..e8acdbefa32bb 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -2319,8 +2319,7 @@ static void writeArchiveStats(Ctx &ctx) {
 
   os << "members\textracted\tarchive\n";
 
-  SmallVector<StringRef, 0> archives;
-  DenseMap<CachedHashStringRef, unsigned> all, extracted;
+  DenseMap<CachedHashStringRef, unsigned> extracted;
   for (ELFFileBase *file : ctx.objectFiles)
     if (file->archiveName.size())
       ++extracted[CachedHashStringRef(file->archiveName)];

diff  --git a/lld/wasm/WriterUtils.cpp b/lld/wasm/WriterUtils.cpp
index f8c408084af0b..b78c354ffb97b 100644
--- a/lld/wasm/WriterUtils.cpp
+++ b/lld/wasm/WriterUtils.cpp
@@ -75,7 +75,6 @@ static std::string toString(const llvm::wasm::WasmLimits &limits) {
 }
 
 std::string toString(const WasmTableType &type) {
-  SmallString<128> ret("");
   return "type=" + toString(static_cast<ValType>(type.ElemType)) +
          "; limits=[" + toString(type.Limits) + "]";
 }


        


More information about the llvm-commits mailing list