summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Symbols.cpp11
-rw-r--r--lld/ELF/Symbols.h2
2 files changed, 4 insertions, 9 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 8ac3e5fcbed..d32d44a3340 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -213,21 +213,18 @@ InputFile *Lazy::fetch() {
return cast<LazyObject>(this)->fetch();
}
-ArchiveFile &LazyArchive::getFile() { return *cast<ArchiveFile>(File); }
-
InputFile *LazyArchive::fetch() {
- std::pair<MemoryBufferRef, uint64_t> MBInfo = getFile().getMember(&Sym);
+ auto *F = cast<ArchiveFile>(File);
+ std::pair<MemoryBufferRef, uint64_t> MBInfo = F->getMember(&Sym);
// getMember returns an empty buffer if the member was already
// read from the library.
if (MBInfo.first.getBuffer().empty())
return nullptr;
- return createObjectFile(MBInfo.first, getFile().getName(), MBInfo.second);
+ return createObjectFile(MBInfo.first, F->getName(), MBInfo.second);
}
-LazyObjFile &LazyObject::getFile() { return *cast<LazyObjFile>(File); }
-
-InputFile *LazyObject::fetch() { return getFile().fetch(); }
+InputFile *LazyObject::fetch() { return cast<LazyObjFile>(File)->fetch(); }
uint8_t Symbol::computeBinding() const {
if (Config->Relocatable)
diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h
index bef5897b131..dde708b6049 100644
--- a/lld/ELF/Symbols.h
+++ b/lld/ELF/Symbols.h
@@ -283,7 +283,6 @@ public:
static bool classof(const Symbol *S) { return S->kind() == LazyArchiveKind; }
- ArchiveFile &getFile();
InputFile *fetch();
private:
@@ -299,7 +298,6 @@ public:
static bool classof(const Symbol *S) { return S->kind() == LazyObjectKind; }
- LazyObjFile &getFile();
InputFile *fetch();
};
OpenPOWER on IntegriCloud