ELF2: Rename getMostConstrainingVisibility -> getVisibility. NFC.

The previous name was too long.

llvm-svn: 250920
This commit is contained in:
Rui Ueyama 2015-10-21 18:13:47 +00:00
parent 3fd13f0665
commit 8f2c4da65a
3 changed files with 10 additions and 14 deletions

View File

@ -573,7 +573,7 @@ bool lld::elf2::canBePreempted(const SymbolBody *Body, bool NeedsGot) {
}
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::includeInSymtab(const SymbolBody &B) {
}
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>::writeGlobalSymbols(uint8_t *Buf) {
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>::writeGlobalSymbols(uint8_t *Buf) {
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))

View File

@ -40,10 +40,8 @@ template <class ELFT> int SymbolBody::compare(SymbolBody *Other) {
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;

View File

@ -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;