Skip to content

Commit 662bb00

Browse files
committed
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
1 parent c0f5648 commit 662bb00

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

lld/ELF/Symbols.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static uint64_t getSymVA(const SymbolBody &Body, int64_t &Addend) {
121121

122122
SymbolBody::SymbolBody(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther,
123123
uint8_t Type)
124-
: SymbolKind(K), NeedsPltAddr(false), IsLocal(IsLocal),
124+
: SymbolKind(K), IsLocal(IsLocal), NeedsPltAddr(false),
125125
IsInGlobalMipsGot(false), Is32BitMipsGot(false), IsInIplt(false),
126126
IsInIgot(false), IsPreemptible(false), Type(Type), StOther(StOther),
127127
Name(Name) {}

lld/ELF/Symbols.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,13 @@ class SymbolBody {
108108

109109
const unsigned SymbolKind : 8;
110110

111+
// True if this is a local symbol.
112+
unsigned IsLocal : 1;
113+
111114
public:
112115
// True the symbol should point to its PLT entry.
113116
// For SharedSymbol only.
114117
unsigned NeedsPltAddr : 1;
115-
116-
// True if this is a local symbol.
117-
unsigned IsLocal : 1;
118-
119118
// True if this symbol has an entry in the global part of MIPS GOT.
120119
unsigned IsInGlobalMipsGot : 1;
121120

lld/ELF/SyntheticSections.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ template <class ELFT> void elf::createCommonSections() {
7575
// Replace all DefinedCommon symbols with DefinedRegular symbols so that we
7676
// don't have to care about DefinedCommon symbols beyond this point.
7777
replaceBody<DefinedRegular>(S, Sym->getFile(), Sym->getName(),
78-
static_cast<bool>(Sym->IsLocal), Sym->StOther,
78+
static_cast<bool>(Sym->isLocal()), Sym->StOther,
7979
Sym->Type, 0, Sym->getSize<ELFT>(), Section);
8080
}
8181
}

lld/ELF/Writer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ template <class ELFT> void Writer<ELFT>::copyLocalSymbols() {
444444
for (InputFile *File : ObjectFiles) {
445445
ObjFile<ELFT> *F = cast<ObjFile<ELFT>>(File);
446446
for (SymbolBody *B : F->getLocalSymbols()) {
447-
if (!B->IsLocal)
447+
if (!B->isLocal())
448448
fatal(toString(F) +
449449
": broken object: getLocalSymbols returns a non-local symbol");
450450
auto *DR = dyn_cast<DefinedRegular>(B);

0 commit comments

Comments
 (0)