[llvm] 796feb6 - [MC][ELF] Fix unused variable warning (NFC)
Yang Fan via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 17 22:23:53 PST 2021
Author: Yang Fan
Date: 2021-02-18T14:23:18+08:00
New Revision: 796feb61637c407aefcc0d462f24a1cc41f350d8
URL: https://github.com/llvm/llvm-project/commit/796feb61637c407aefcc0d462f24a1cc41f350d8
DIFF: https://github.com/llvm/llvm-project/commit/796feb61637c407aefcc0d462f24a1cc41f350d8.diff
LOG: [MC][ELF] Fix unused variable warning (NFC)
GCC warning:
```
/llvm-project/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp: In member function ‘virtual llvm::MCSection* llvm::TargetLoweringObjectFileELF::getSectionForLSDA(const llvm::Function&, const llvm::MCSymbol&, const llvm::TargetMachine&) const’:
/llvm-project/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:871:8: warning: variable ‘IsComdat’ set but not used [-Wunused-but-set-variable]
871 | bool IsComdat = false;
| ^~~~~~~~
```
Added:
Modified:
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 49c9d46f5872..7d3d40296022 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -868,11 +868,9 @@ MCSection *TargetLoweringObjectFileELF::getSectionForLSDA(
unsigned Flags = LSDA->getFlags();
const MCSymbolELF *LinkedToSym = nullptr;
StringRef Group;
- bool IsComdat = false;
if (const Comdat *C = getELFComdat(&F)) {
Flags |= ELF::SHF_GROUP;
Group = C->getName();
- IsComdat = C->getSelectionKind() == Comdat::Any;
}
// Use SHF_LINK_ORDER to facilitate --gc-sections if we can use GNU ld>=2.36
// or LLD, which support mixed SHF_LINK_ORDER & non-SHF_LINK_ORDER.
More information about the llvm-commits
mailing list