Remove Symbol::isPreemptible().

Because it was a redundant accessor to Symbol's public member.

llvm-svn: 315609
This commit is contained in:
Rui Ueyama 2017-10-12 19:10:41 +00:00
parent 70303c011f
commit ca05b6fb79
3 changed files with 8 additions and 9 deletions

View File

@ -97,7 +97,7 @@ static bool isPreemptible(const SymbolBody &Body, RelType Type) {
Type == R_MICROMIPS_GPREL7_S2)
return false;
}
return Body.isPreemptible();
return Body.IsPreemptible;
}
// This function is similar to the `handleTlsRelocation`. MIPS does not
@ -120,11 +120,11 @@ static unsigned handleMipsTlsRelocation(RelType Type, SymbolBody &Body,
}
if (Expr == R_MIPS_TLSGD) {
if (InX::MipsGot->addDynTlsEntry(Body) && Body.isPreemptible()) {
if (InX::MipsGot->addDynTlsEntry(Body) && Body.IsPreemptible) {
uint64_t Off = InX::MipsGot->getGlobalDynOffset(Body);
In<ELFT>::RelaDyn->addReloc(
{Target->TlsModuleIndexRel, InX::MipsGot, Off, false, &Body, 0});
if (Body.isPreemptible())
if (Body.IsPreemptible)
In<ELFT>::RelaDyn->addReloc({Target->TlsOffsetRel, InX::MipsGot,
Off + Config->Wordsize, false, &Body, 0});
}
@ -155,8 +155,8 @@ static unsigned handleARMTlsRelocation(RelType Type, SymbolBody &Body,
// The Dynamic TLS Module Index Relocation for a symbol defined in an
// executable is always 1. If the target Symbol is not preemptible then
// we know the offset into the TLS block at static link time.
bool NeedDynId = Body.isPreemptible() || Config->Shared;
bool NeedDynOff = Body.isPreemptible();
bool NeedDynId = Body.IsPreemptible || Config->Shared;
bool NeedDynOff = Body.IsPreemptible;
auto AddTlsReloc = [&](uint64_t Off, RelType Type, SymbolBody *Dest,
bool Dyn) {
@ -923,7 +923,7 @@ static void scanRelocs(InputSectionBase &Sec, ArrayRef<RelTy> Rels) {
// for detailed description:
// ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
InX::MipsGot->addEntry(Body, Addend, Expr);
if (Body.isTls() && Body.isPreemptible())
if (Body.isTls() && Body.IsPreemptible)
In<ELFT>::RelaDyn->addReloc({Target->TlsGotRel, InX::MipsGot,
Body.getGotOffset(), false, &Body, 0});
} else if (!Body.isInGot()) {

View File

@ -76,7 +76,6 @@ public:
bool isUndefWeak() const;
InputFile *getFile() const;
bool isPreemptible() const { return IsPreemptible; }
StringRef getName() const { return Name; }
uint8_t getVisibility() const { return StOther & 0x3; }
void parseSymbolVersion();

View File

@ -734,7 +734,7 @@ void MipsGotSection::addEntry(SymbolBody &Sym, int64_t Addend, RelExpr Expr) {
if (!A)
S.GotIndex = NewIndex;
};
if (Sym.isPreemptible()) {
if (Sym.IsPreemptible) {
// Ignore addends for preemptible symbols. They got single GOT entry anyway.
AddEntry(Sym, 0, GlobalEntries);
Sym.IsInGlobalMipsGot = true;
@ -910,7 +910,7 @@ void MipsGotSection::writeTo(uint8_t *Buf) {
if (TlsIndexOff != -1U && !Config->Pic)
writeUint(Buf + TlsIndexOff, 1);
for (const SymbolBody *B : TlsEntries) {
if (!B || B->isPreemptible())
if (!B || B->IsPreemptible)
continue;
uint64_t VA = B->getVA();
if (B->GotIndex != -1U) {