-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[lld] Remove unused local variables (NFC) #138470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kazutakahirata
merged 1 commit into
llvm:main
from
kazutakahirata:cleanup_001_tidy_bugprone-unused-local-non-trivial-variable_lld
May 4, 2025
Merged
[lld] Remove unused local variables (NFC) #138470
kazutakahirata
merged 1 commit into
llvm:main
from
kazutakahirata:cleanup_001_tidy_bugprone-unused-local-non-trivial-variable_lld
May 4, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-lld @llvm/pr-subscribers-lld-wasm Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/138470.diff 3 Files Affected:
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) + "]";
}
|
@llvm/pr-subscribers-lld-coff Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/138470.diff 3 Files Affected:
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) + "]";
}
|
nikic
approved these changes
May 4, 2025
MaskRay
approved these changes
May 4, 2025
IanWood1
pushed a commit
to IanWood1/llvm-project
that referenced
this pull request
May 6, 2025
IanWood1
pushed a commit
to IanWood1/llvm-project
that referenced
this pull request
May 6, 2025
IanWood1
pushed a commit
to IanWood1/llvm-project
that referenced
this pull request
May 6, 2025
GeorgeARM
pushed a commit
to GeorgeARM/llvm-project
that referenced
this pull request
May 7, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.