ELF: Merge DefinedRegular and Defined.

Now that DefinedRegular is the only remaining derived class of
Defined, we can merge the two classes.

Differential Revision: https://reviews.llvm.org/D39667

llvm-svn: 317448
This commit is contained in:
Peter Collingbourne
2017-11-06 04:35:31 +00:00
parent 6c55a70838
commit e9a9e0a1e7
20 changed files with 111 additions and 127 deletions

View File

@@ -51,7 +51,7 @@ static std::vector<Defined *> getSymbols() {
std::vector<Defined *> V;
for (InputFile *File : ObjectFiles)
for (Symbol *B : File->getSymbols())
if (auto *DR = dyn_cast<DefinedRegular>(B))
if (auto *DR = dyn_cast<Defined>(B))
if (DR->getFile() == File && !DR->isSection() && DR->Section &&
DR->Section->Live)
V.push_back(DR);
@@ -62,7 +62,7 @@ static std::vector<Defined *> getSymbols() {
static SymbolMapTy getSectionSyms(ArrayRef<Defined *> Syms) {
SymbolMapTy Ret;
for (Defined *S : Syms)
if (auto *DR = dyn_cast<DefinedRegular>(S))
if (auto *DR = dyn_cast<Defined>(S))
Ret[DR->Section].push_back(S);
// Sort symbols by address. We want to print out symbols in the