diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-09-13 19:56:27 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-09-13 19:56:27 +0000 |
| commit | 3e9037d41990041bb1f08f4e24d3ae104deb78be (patch) | |
| tree | 47e4cba6083a591139088687bd70a066d51570ba | |
| parent | a75b7a48f17737c2f00c9db62619718afcb812b6 (diff) | |
| download | bcm5719-llvm-3e9037d41990041bb1f08f4e24d3ae104deb78be.tar.gz bcm5719-llvm-3e9037d41990041bb1f08f4e24d3ae104deb78be.zip | |
Inline small funciton.
llvm-svn: 281381
| -rw-r--r-- | lld/ELF/MarkLive.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index 90327133e06..6cd5ef7c91c 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -77,25 +77,20 @@ static ResolvedReloc<ELFT> resolveReloc(InputSectionBase<ELFT> &Sec, return {D->Section->Repl, Offset}; } -template <class ELFT, class Elf_Shdr> -static void run(ELFFile<ELFT> &Obj, InputSectionBase<ELFT> &Sec, - Elf_Shdr *RelSec, std::function<void(ResolvedReloc<ELFT>)> 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 <class ELFT> static void forEachSuccessor(InputSection<ELFT> &Sec, std::function<void(ResolvedReloc<ELFT>)> Fn) { ELFFile<ELFT> &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. |

