[lld] r290932 - ELF: Simplify; addOptionalSynthetic() does not need to return a value. NFC.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 3 18:43:01 PST 2017
Author: pcc
Date: Tue Jan 3 20:43:01 2017
New Revision: 290932
URL: http://llvm.org/viewvc/llvm-project?rev=290932&view=rev
Log:
ELF: Simplify; addOptionalSynthetic() does not need to return a value. NFC.
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=290932&r1=290931&r2=290932&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Jan 3 20:43:01 2017
@@ -625,15 +625,12 @@ void PhdrEntry::add(OutputSectionBase *S
}
template <class ELFT>
-static Symbol *addOptionalSynthetic(StringRef Name, OutputSectionBase *Sec,
- typename ELFT::uint Val,
- uint8_t StOther = STV_HIDDEN) {
- SymbolBody *S = Symtab<ELFT>::X->find(Name);
- if (!S)
- return nullptr;
- if (!S->isUndefined() && !S->isShared())
- return S->symbol();
- return Symtab<ELFT>::X->addSynthetic(Name, Sec, Val, StOther);
+static void addOptionalSynthetic(StringRef Name, OutputSectionBase *Sec,
+ typename ELFT::uint Val,
+ uint8_t StOther = STV_HIDDEN) {
+ if (SymbolBody *S = Symtab<ELFT>::X->find(Name))
+ if (S->isUndefined() || S->isShared())
+ Symtab<ELFT>::X->addSynthetic(Name, Sec, Val, StOther);
}
template <class ELFT>
More information about the llvm-commits
mailing list