[lld] r258940 - Remove redundant variable.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 27 08:41:24 PST 2016
Author: rafael
Date: Wed Jan 27 10:41:24 2016
New Revision: 258940
URL: http://llvm.org/viewvc/llvm-project?rev=258940&view=rev
Log:
Remove redundant variable.
Modified:
lld/trunk/ELF/OutputSections.cpp
lld/trunk/ELF/OutputSections.h
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=258940&r1=258939&r2=258940&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Wed Jan 27 10:41:24 2016
@@ -1461,7 +1461,6 @@ template <class ELFT> void SymbolTableSe
template <class ELFT>
void SymbolTableSection<ELFT>::addLocalSymbol(StringRef Name) {
StrTabSec.reserve(Name);
- ++NumVisible;
++NumLocals;
}
@@ -1469,7 +1468,6 @@ template <class ELFT>
void SymbolTableSection<ELFT>::addSymbol(SymbolBody *Body) {
StrTabSec.reserve(Body->getName());
Symbols.push_back(Body);
- ++NumVisible;
}
template <class ELFT> void SymbolTableSection<ELFT>::writeTo(uint8_t *Buf) {
Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=258940&r1=258939&r2=258940&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Wed Jan 27 10:41:24 2016
@@ -203,7 +203,7 @@ public:
void addLocalSymbol(StringRef Name);
void addSymbol(SymbolBody *Body);
StringTableSection<ELFT> &getStrTabSec() const { return StrTabSec; }
- unsigned getNumSymbols() const { return NumVisible + 1; }
+ unsigned getNumSymbols() const { return NumLocals + Symbols.size() + 1; }
ArrayRef<SymbolBody *> getSymbols() const { return Symbols; }
@@ -216,7 +216,6 @@ private:
SymbolTable<ELFT> &Table;
StringTableSection<ELFT> &StrTabSec;
std::vector<SymbolBody *> Symbols;
- unsigned NumVisible = 0;
unsigned NumLocals = 0;
};
More information about the llvm-commits
mailing list