Hide SymbolBody::IsLocal.

IsLocal member is initialized by the constructor and will never change.
So we don't want to make it directly accessible.

llvm-svn: 315667
This commit is contained in:
Rui Ueyama
2017-10-13 03:37:26 +00:00
parent c0f564815c
commit 662bb00028
4 changed files with 6 additions and 7 deletions

View File

@@ -121,7 +121,7 @@ static uint64_t getSymVA(const SymbolBody &Body, int64_t &Addend) {
SymbolBody::SymbolBody(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther,
uint8_t Type)
: SymbolKind(K), NeedsPltAddr(false), IsLocal(IsLocal),
: SymbolKind(K), IsLocal(IsLocal), NeedsPltAddr(false),
IsInGlobalMipsGot(false), Is32BitMipsGot(false), IsInIplt(false),
IsInIgot(false), IsPreemptible(false), Type(Type), StOther(StOther),
Name(Name) {}

View File

@@ -108,14 +108,13 @@ protected:
const unsigned SymbolKind : 8;
// True if this is a local symbol.
unsigned IsLocal : 1;
public:
// True the symbol should point to its PLT entry.
// For SharedSymbol only.
unsigned NeedsPltAddr : 1;
// True if this is a local symbol.
unsigned IsLocal : 1;
// True if this symbol has an entry in the global part of MIPS GOT.
unsigned IsInGlobalMipsGot : 1;

View File

@@ -75,7 +75,7 @@ template <class ELFT> void elf::createCommonSections() {
// Replace all DefinedCommon symbols with DefinedRegular symbols so that we
// don't have to care about DefinedCommon symbols beyond this point.
replaceBody<DefinedRegular>(S, Sym->getFile(), Sym->getName(),
static_cast<bool>(Sym->IsLocal), Sym->StOther,
static_cast<bool>(Sym->isLocal()), Sym->StOther,
Sym->Type, 0, Sym->getSize<ELFT>(), Section);
}
}

View File

@@ -444,7 +444,7 @@ template <class ELFT> void Writer<ELFT>::copyLocalSymbols() {
for (InputFile *File : ObjectFiles) {
ObjFile<ELFT> *F = cast<ObjFile<ELFT>>(File);
for (SymbolBody *B : F->getLocalSymbols()) {
if (!B->IsLocal)
if (!B->isLocal())
fatal(toString(F) +
": broken object: getLocalSymbols returns a non-local symbol");
auto *DR = dyn_cast<DefinedRegular>(B);