[lld] r252934 - ELF2: Make type a bit stricter. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 12 11:42:43 PST 2015
Author: ruiu
Date: Thu Nov 12 13:42:43 2015
New Revision: 252934
URL: http://llvm.org/viewvc/llvm-project?rev=252934&view=rev
Log:
ELF2: Make type a bit stricter. NFC.
Modified:
lld/trunk/ELF/MarkLive.cpp
Modified: lld/trunk/ELF/MarkLive.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MarkLive.cpp?rev=252934&r1=252933&r2=252934&view=diff
==============================================================================
--- lld/trunk/ELF/MarkLive.cpp (original)
+++ lld/trunk/ELF/MarkLive.cpp Thu Nov 12 13:42:43 2015
@@ -76,13 +76,14 @@ template <class ELFT> static bool isRese
}
template <class ELFT> void lld::elf2::markLive(SymbolTable<ELFT> *Symtab) {
- SmallVector<InputSectionBase<ELFT> *, 256> Q;
+ SmallVector<InputSection<ELFT> *, 256> Q;
auto Enqueue = [&](InputSectionBase<ELFT> *Sec) {
if (!Sec || Sec->Live)
return;
Sec->Live = true;
- Q.push_back(Sec);
+ if (InputSection<ELFT> *S = dyn_cast<InputSection<ELFT>>(Sec))
+ Q.push_back(S);
};
auto MarkSymbol = [&](SymbolBody *Sym) {
@@ -124,8 +125,7 @@ template <class ELFT> void lld::elf2::ma
// Mark all reachable sections.
while (!Q.empty())
- if (auto *Sec = dyn_cast<InputSection<ELFT>>(Q.pop_back_val()))
- forEachSuccessor<ELFT>(Sec, Enqueue);
+ forEachSuccessor<ELFT>(Q.pop_back_val(), Enqueue);
}
template void lld::elf2::markLive<ELF32LE>(SymbolTable<ELF32LE> *);
More information about the llvm-commits
mailing list