Inline two trivial functions that are called only once. NFC.

llvm-svn: 329034
This commit is contained in:
Rui Ueyama 2018-04-02 23:58:50 +00:00
parent 64521bed0d
commit 7d6131a898
2 changed files with 4 additions and 9 deletions

View File

@ -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)

View File

@ -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();
};