summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-07-03 16:05:51 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-07-03 16:05:51 +0000
commitd971e7030ef8d4370c9df26b6faccea96662804c (patch)
treeeb2b428da76436cce5eb62980956cd6156d93843
parentb5c68a6717082eed1afe80c01e3cf2283ea90f7f (diff)
downloadbcm5719-llvm-d971e7030ef8d4370c9df26b6faccea96662804c.tar.gz
bcm5719-llvm-d971e7030ef8d4370c9df26b6faccea96662804c.zip
[ELF] - Simplify allocateHeaders(). NFC.
* Return type changed to void, because it was unused. * std::find_if -> llvm::find_if llvm-svn: 307039
-rw-r--r--lld/ELF/LinkerScript.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 8b239c4d022..8110d945856 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -784,22 +784,21 @@ void LinkerScript::processNonSectionCommands() {
}
}
-static bool
+static void
allocateHeaders(std::vector<PhdrEntry> &Phdrs,
ArrayRef<OutputSectionCommand *> OutputSectionCommands,
uint64_t Min) {
- auto FirstPTLoad =
- std::find_if(Phdrs.begin(), Phdrs.end(),
- [](const PhdrEntry &E) { return E.p_type == PT_LOAD; });
+ auto FirstPTLoad = llvm::find_if(
+ Phdrs, [](const PhdrEntry &E) { return E.p_type == PT_LOAD; });
if (FirstPTLoad == Phdrs.end())
- return false;
+ return;
uint64_t HeaderSize = getHeaderSize();
if (HeaderSize <= Min || Script->hasPhdrsCommands()) {
Min = alignDown(Min - HeaderSize, Config->MaxPageSize);
Out::ElfHeader->Addr = Min;
Out::ProgramHeaders->Addr = Min + Out::ElfHeader->Size;
- return true;
+ return;
}
assert(FirstPTLoad->First == Out::ElfHeader);
@@ -822,12 +821,10 @@ allocateHeaders(std::vector<PhdrEntry> &Phdrs,
Phdrs.erase(FirstPTLoad);
}
- auto PhdrI = std::find_if(Phdrs.begin(), Phdrs.end(), [](const PhdrEntry &E) {
- return E.p_type == PT_PHDR;
- });
+ auto PhdrI = llvm::find_if(
+ Phdrs, [](const PhdrEntry &E) { return E.p_type == PT_PHDR; });
if (PhdrI != Phdrs.end())
Phdrs.erase(PhdrI);
- return false;
}
void LinkerScript::assignAddresses(std::vector<PhdrEntry> &Phdrs) {
OpenPOWER on IntegriCloud