[lld] r250920 - ELF2: Rename getMostConstrainingVisibility -> getVisibility. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 21 11:13:48 PDT 2015
Author: ruiu
Date: Wed Oct 21 13:13:47 2015
New Revision: 250920
URL: http://llvm.org/viewvc/llvm-project?rev=250920&view=rev
Log:
ELF2: Rename getMostConstrainingVisibility -> getVisibility. NFC.
The previous name was too long.
Modified:
lld/trunk/ELF/OutputSections.cpp
lld/trunk/ELF/Symbols.cpp
lld/trunk/ELF/Symbols.h
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=250920&r1=250919&r2=250920&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Wed Oct 21 13:13:47 2015
@@ -573,7 +573,7 @@ bool lld::elf2::canBePreempted(const Sym
}
if (!Config->Shared)
return false;
- return Body->getMostConstrainingVisibility() == STV_DEFAULT;
+ return Body->getVisibility() == STV_DEFAULT;
}
template <class ELFT> void OutputSection<ELFT>::writeTo(uint8_t *Buf) {
@@ -645,7 +645,7 @@ template <class ELFT> bool lld::elf2::in
}
bool lld::elf2::includeInDynamicSymtab(const SymbolBody &B) {
- uint8_t V = B.getMostConstrainingVisibility();
+ uint8_t V = B.getVisibility();
if (V != STV_DEFAULT && V != STV_PROTECTED)
return false;
@@ -803,7 +803,7 @@ void SymbolTableSection<ELFT>::writeGlob
ESym->setBindingAndType(getSymbolBinding(Body), Type);
ESym->st_size = Size;
- ESym->setVisibility(Body->getMostConstrainingVisibility());
+ ESym->setVisibility(Body->getVisibility());
ESym->st_value = getSymVA<ELFT>(*Body);
if (Section)
@@ -820,7 +820,7 @@ void SymbolTableSection<ELFT>::writeGlob
template <class ELFT>
uint8_t SymbolTableSection<ELFT>::getSymbolBinding(SymbolBody *Body) {
- uint8_t Visibility = Body->getMostConstrainingVisibility();
+ uint8_t Visibility = Body->getVisibility();
if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
return STB_LOCAL;
if (const auto *EBody = dyn_cast<ELFSymbolBody<ELFT>>(Body))
Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=250920&r1=250919&r2=250920&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Wed Oct 21 13:13:47 2015
@@ -40,10 +40,8 @@ template <class ELFT> int SymbolBody::co
if (L > R)
return -Other->compare<ELFT>(this);
- uint8_t LV = getMostConstrainingVisibility();
- uint8_t RV = Other->getMostConstrainingVisibility();
- MostConstrainingVisibility = getMinVisibility(LV, RV);
- Other->MostConstrainingVisibility = MostConstrainingVisibility;
+ Visibility = Other->Visibility =
+ getMinVisibility(Visibility, Other->Visibility);
IsUsedInRegularObj |= Other->IsUsedInRegularObj;
Other->IsUsedInRegularObj |= IsUsedInRegularObj;
Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=250920&r1=250919&r2=250920&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Wed Oct 21 13:13:47 2015
@@ -83,9 +83,7 @@ public:
// Returns the symbol name.
StringRef getName() const { return Name; }
- uint8_t getMostConstrainingVisibility() const {
- return MostConstrainingVisibility;
- }
+ uint8_t getVisibility() const { return Visibility; }
unsigned getDynamicSymbolTableIndex() const {
return DynamicSymbolTableIndex;
@@ -116,15 +114,15 @@ public:
protected:
SymbolBody(Kind K, StringRef Name, bool IsWeak, uint8_t Visibility,
bool IsTLS)
- : SymbolKind(K), IsWeak(IsWeak), MostConstrainingVisibility(Visibility),
- IsTLS(IsTLS), Name(Name) {
+ : SymbolKind(K), IsWeak(IsWeak), Visibility(Visibility), IsTLS(IsTLS),
+ Name(Name) {
IsUsedInRegularObj = K != SharedKind && K != LazyKind;
IsUsedInDynamicReloc = 0;
}
const unsigned SymbolKind : 8;
unsigned IsWeak : 1;
- unsigned MostConstrainingVisibility : 2;
+ unsigned Visibility : 2;
unsigned IsUsedInRegularObj : 1;
unsigned IsUsedInDynamicReloc : 1;
unsigned IsTLS : 1;
More information about the llvm-commits
mailing list