[lld] r291602 - Inline a simple accessor function.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 10 13:52:56 PST 2017
Author: ruiu
Date: Tue Jan 10 15:52:56 2017
New Revision: 291602
URL: http://llvm.org/viewvc/llvm-project?rev=291602&view=rev
Log:
Inline a simple accessor function.
Modified:
lld/trunk/ELF/SyntheticSections.cpp
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=291602&r1=291601&r2=291602&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Tue Jan 10 15:52:56 2017
@@ -1060,10 +1060,6 @@ static bool sortMipsSymbols(const Symbol
return L->GotIndex < R->GotIndex;
}
-static uint8_t getSymbolBinding(SymbolBody *Body) {
- return Body->symbol()->computeBinding();
-}
-
template <class ELFT> void SymbolTableSection<ELFT>::finalize() {
this->OutSec->Link = this->Link = StrTabSec.OutSec->SectionIndex;
this->OutSec->Info = this->Info = NumLocals + 1;
@@ -1077,11 +1073,12 @@ template <class ELFT> void SymbolTableSe
}
if (!StrTabSec.isDynamic()) {
- std::stable_sort(Symbols.begin(), Symbols.end(),
- [](const SymbolTableEntry &L, const SymbolTableEntry &R) {
- return getSymbolBinding(L.Symbol) == STB_LOCAL &&
- getSymbolBinding(R.Symbol) != STB_LOCAL;
- });
+ std::stable_sort(
+ Symbols.begin(), Symbols.end(),
+ [](const SymbolTableEntry &L, const SymbolTableEntry &R) {
+ return L.Symbol->symbol()->computeBinding() == STB_LOCAL &&
+ R.Symbol->symbol()->computeBinding() != STB_LOCAL;
+ });
return;
}
if (In<ELFT>::GnuHashTab)
@@ -1151,7 +1148,7 @@ void SymbolTableSection<ELFT>::writeGlob
uint8_t Type = Body->Type;
uintX_t Size = Body->getSize<ELFT>();
- ESym->setBindingAndType(getSymbolBinding(Body), Type);
+ ESym->setBindingAndType(Body->symbol()->computeBinding(), Type);
ESym->st_size = Size;
ESym->st_name = StrOff;
ESym->setVisibility(Body->symbol()->Visibility);
More information about the llvm-commits
mailing list