Move File from SymbolBody to Symbol.
With this Symbol has the same size as before, but DefinedRegular goes
from 72 to 64 bytes.
I also find this a bit easier to read. There are fewer places
initializing File for example.
This has a small but measurable speed improvement on all tests (1%
max).
llvm-svn: 310142
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index e140e0a..2fe592e 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -502,7 +502,7 @@
auto *Sym =
make<DefinedRegular>("", /*IsLocal=*/true, /*StOther=*/0, STT_SECTION,
- /*Value=*/0, /*Size=*/0, IS, nullptr);
+ /*Value=*/0, /*Size=*/0, IS);
InX::SymTab->addSymbol(Sym);
}
}
@@ -1204,7 +1204,7 @@
if (InX::DynSymTab && S->includeInDynsym()) {
InX::DynSymTab->addSymbol(Body);
if (auto *SS = dyn_cast<SharedSymbol>(Body))
- if (cast<SharedFile<ELFT>>(SS->File)->isNeeded())
+ if (cast<SharedFile<ELFT>>(S->File)->isNeeded())
In<ELFT>::VerNeed->addSymbol(SS);
}
}