summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-01-04 02:43:01 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-01-04 02:43:01 +0000
commit578af61b0946b21ad82f09379f9326459b31a823 (patch)
tree89eedbad56af3603c9e6dc383e77984ef66f654f
parent46b6597296a3b662ec6d9d575390cf8f7525b3bc (diff)
downloadbcm5719-llvm-578af61b0946b21ad82f09379f9326459b31a823.tar.gz
bcm5719-llvm-578af61b0946b21ad82f09379f9326459b31a823.zip
ELF: Simplify; addOptionalSynthetic() does not need to return a value. NFC.
llvm-svn: 290932
-rw-r--r--lld/ELF/Writer.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index e056384fbd4..80a636c26ec 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -625,15 +625,12 @@ void PhdrEntry::add(OutputSectionBase *Sec) {
}
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>
OpenPOWER on IntegriCloud