diff options
author | Rui Ueyama <ruiu@google.com> | 2016-01-11 23:50:55 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-01-11 23:50:55 +0000 |
commit | f949f7f15e3bd006e0f1f0980979aa6420193fd5 (patch) | |
tree | 839f6fa3a6bf28e6ef4b4b4b278280e6992df90f | |
parent | 1602605bf85f4fcc37aa2481a0e9ad7772444c47 (diff) | |
download | bcm5719-llvm-f949f7f15e3bd006e0f1f0980979aa6420193fd5.tar.gz bcm5719-llvm-f949f7f15e3bd006e0f1f0980979aa6420193fd5.zip |
Merge two small functions. NFC.
llvm-svn: 257418
-rw-r--r-- | lld/ELF/Writer.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index f79d400ec78..16a9e8d4cf4 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -650,25 +650,22 @@ OutputSectionFactory<ELFT>::create(InputSectionBase<ELFT> *C, OutputSectionBase<ELFT> *&Sec = Map[Key]; if (Sec) return {Sec, false}; - Sec = createAux(C, Key); - return {Sec, true}; -} -template <class ELFT> -OutputSectionBase<ELFT> * -OutputSectionFactory<ELFT>::createAux(InputSectionBase<ELFT> *C, - const SectionKey<ELFT::Is64Bits> &Key) { switch (C->SectionKind) { case InputSectionBase<ELFT>::Regular: - return new OutputSection<ELFT>(Key.Name, Key.Type, Key.Flags); + Sec = new OutputSection<ELFT>(Key.Name, Key.Type, Key.Flags); + break; case InputSectionBase<ELFT>::EHFrame: - return new EHOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags); + Sec = new EHOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags); + break; case InputSectionBase<ELFT>::Merge: - return new MergeOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags); + Sec = new MergeOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags); + break; case InputSectionBase<ELFT>::MipsReginfo: - return new MipsReginfoOutputSection<ELFT>(); + Sec = new MipsReginfoOutputSection<ELFT>(); + break; } - llvm_unreachable("Unknown output section type"); + return {Sec, true}; } template <class ELFT> |