From: Rui Ueyama Date: Mon, 2 Apr 2018 23:58:50 +0000 (+0000) Subject: Inline two trivial functions that are called only once. NFC. X-Git-Tag: llvmorg-7.0.0-rc1~9156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d6131a898690f4b4bd6de64ef863125f50973ec;p=platform%2Fupstream%2Fllvm.git Inline two trivial functions that are called only once. NFC. llvm-svn: 329034 --- diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp index 8ac3e5f..d32d44a 100644 --- a/lld/ELF/Symbols.cpp +++ b/lld/ELF/Symbols.cpp @@ -213,21 +213,18 @@ InputFile *Lazy::fetch() { return cast(this)->fetch(); } -ArchiveFile &LazyArchive::getFile() { return *cast(File); } - InputFile *LazyArchive::fetch() { - std::pair MBInfo = getFile().getMember(&Sym); + auto *F = cast(File); + std::pair 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(File); } - -InputFile *LazyObject::fetch() { return getFile().fetch(); } +InputFile *LazyObject::fetch() { return cast(File)->fetch(); } uint8_t Symbol::computeBinding() const { if (Config->Relocatable) diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h index bef5897..dde708b 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(); };