Merge two small functions. NFC.
llvm-svn: 257418
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index f79d400..16a9e8d 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -650,25 +650,22 @@
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>