From: Rui Ueyama Date: Tue, 13 Sep 2016 19:56:27 +0000 (+0000) Subject: Inline small funciton. X-Git-Tag: llvmorg-4.0.0-rc1~9900 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e9037d41990041bb1f08f4e24d3ae104deb78be;p=platform%2Fupstream%2Fllvm.git Inline small funciton. llvm-svn: 281381 --- diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index 9032713..6cd5ef7 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -77,25 +77,20 @@ static ResolvedReloc resolveReloc(InputSectionBase &Sec, return {D->Section->Repl, Offset}; } -template -static void run(ELFFile &Obj, InputSectionBase &Sec, - Elf_Shdr *RelSec, std::function)> Fn) { - if (RelSec->sh_type == SHT_RELA) { - for (const typename ELFT::Rela &RI : Obj.relas(RelSec)) - Fn(resolveReloc(Sec, RI)); - } else { - for (const typename ELFT::Rel &RI : Obj.rels(RelSec)) - Fn(resolveReloc(Sec, RI)); - } -} - // Calls Fn for each section that Sec refers to via relocations. template static void forEachSuccessor(InputSection &Sec, std::function)> Fn) { ELFFile &Obj = Sec.getFile()->getObj(); - for (const typename ELFT::Shdr *RelSec : Sec.RelocSections) - run(Obj, Sec, RelSec, Fn); + for (const typename ELFT::Shdr *RelSec : Sec.RelocSections) { + if (RelSec->sh_type == SHT_RELA) { + for (const typename ELFT::Rela &Rel : Obj.relas(RelSec)) + Fn(resolveReloc(Sec, Rel)); + } else { + for (const typename ELFT::Rel &Rel : Obj.rels(RelSec)) + Fn(resolveReloc(Sec, Rel)); + } + } } // The .eh_frame section is an unfortunate special case.