summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2019-04-05 01:30:09 +0000
committerRui Ueyama <ruiu@google.com>2019-04-05 01:30:09 +0000
commit7c28937baf393059e5b97a694c79adbbcc3d2cc2 (patch)
tree5443ecd26b60c20d1721fea8380ff67c8cd9f830
parenta116d91ba2ad0a648d5359c4f6e79394a51729a6 (diff)
downloadbcm5719-llvm-7c28937baf393059e5b97a694c79adbbcc3d2cc2.tar.gz
bcm5719-llvm-7c28937baf393059e5b97a694c79adbbcc3d2cc2.zip
Remove redundant parameters. NFC.
llvm-svn: 357738
-rw-r--r--lld/ELF/Writer.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 686dda4cb12..15a4dc2b13a 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -560,9 +560,8 @@ template <class ELFT> void Writer<ELFT>::run() {
error("failed to write to the output file: " + toString(std::move(E)));
}
-static bool shouldKeepInSymtab(SectionBase *Sec, StringRef SymName,
- const Symbol &B) {
- if (B.isSection())
+static bool shouldKeepInSymtab(const Defined &Sym) {
+ if (Sym.isSection())
return false;
if (Config->Discard == DiscardPolicy::None)
@@ -573,12 +572,15 @@ static bool shouldKeepInSymtab(SectionBase *Sec, StringRef SymName,
// * --discard-locals is used.
// * The symbol is in a SHF_MERGE section, which is normally the reason for
// the assembler keeping the .L symbol.
- if (!SymName.startswith(".L") && !SymName.empty())
+ StringRef Name = Sym.getName();
+ bool IsLocal = Name.startswith(".L") || Name.empty();
+ if (!IsLocal)
return true;
if (Config->Discard == DiscardPolicy::Locals)
return false;
+ SectionBase *Sec = Sym.Section;
return !Sec || !(Sec->Flags & SHF_MERGE);
}
@@ -623,9 +625,7 @@ template <class ELFT> void Writer<ELFT>::copyLocalSymbols() {
continue;
if (!includeInSymtab(*B))
continue;
-
- SectionBase *Sec = DR->Section;
- if (!shouldKeepInSymtab(Sec, B->getName(), *B))
+ if (!shouldKeepInSymtab(*DR))
continue;
In.SymTab->addSymbol(B);
}
OpenPOWER on IntegriCloud