[lld] r258996 - Do not use return with a function whose return type is void.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 27 14:23:44 PST 2016
Author: ruiu
Date: Wed Jan 27 16:23:44 2016
New Revision: 258996
URL: http://llvm.org/viewvc/llvm-project?rev=258996&view=rev
Log:
Do not use return with a function whose return type is void.
Although it is syntactically correct, it is a bit confusing, and
not necessary here.
Modified:
lld/trunk/ELF/OutputSections.cpp
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=258996&r1=258995&r2=258996&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Wed Jan 27 16:23:44 2016
@@ -1207,13 +1207,15 @@ template <class ELFT>
void EHOutputSection<ELFT>::addSection(InputSectionBase<ELFT> *C) {
auto *S = cast<EHInputSection<ELFT>>(C);
const Elf_Shdr *RelSec = S->RelocSection;
- if (!RelSec)
- return addSectionAux(
- S, make_range((const Elf_Rela *)nullptr, (const Elf_Rela *)nullptr));
+ if (!RelSec) {
+ addSectionAux(S, make_range<const Elf_Rela *>(nullptr, nullptr));
+ return;
+ }
ELFFile<ELFT> &Obj = S->getFile()->getObj();
if (RelSec->sh_type == SHT_RELA)
- return addSectionAux(S, Obj.relas(RelSec));
- return addSectionAux(S, Obj.rels(RelSec));
+ addSectionAux(S, Obj.relas(RelSec));
+ else
+ addSectionAux(S, Obj.rels(RelSec));
}
template <class ELFT>
More information about the llvm-commits
mailing list