mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-07 16:42:34 +00:00
Always use parallel_for_each because it falls back to std::for_each.
If multi-threading is disabled, parallel_for_each will automatically fall back to std::for_each, so we don't have to do that ourselves. llvm-svn: 285968
This commit is contained in:
parent
7747cb55dc
commit
5bc0323c11
@ -1064,13 +1064,8 @@ template <class ELFT> void OutputSection<ELFT>::writeTo(uint8_t *Buf) {
|
||||
ArrayRef<uint8_t> Filler = Script<ELFT>::X->getFiller(this->Name);
|
||||
if (!Filler.empty())
|
||||
fill(Buf, this->getSize(), Filler);
|
||||
if (Config->Threads) {
|
||||
parallel_for_each(Sections.begin(), Sections.end(),
|
||||
[=](InputSection<ELFT> *C) { C->writeTo(Buf); });
|
||||
} else {
|
||||
for (InputSection<ELFT> *C : Sections)
|
||||
C->writeTo(Buf);
|
||||
}
|
||||
parallel_for_each(Sections.begin(), Sections.end(),
|
||||
[=](InputSection<ELFT> *C) { C->writeTo(Buf); });
|
||||
// Linker scripts may have BYTE()-family commands with which you
|
||||
// can write arbitrary bytes to the output. Process them if any.
|
||||
Script<ELFT>::X->writeDataBytes(this->Name, Buf);
|
||||
|
Loading…
Reference in New Issue
Block a user