COFF: Use parallel_sort in Writer::sortExceptionTable().

This patch saves 4 ms out of 5 ms. Very small improvement,
but maybe better than nothing.

llvm-svn: 248063
This commit is contained in:
Rui Ueyama 2015-09-18 23:17:34 +00:00
parent 666892051c
commit 8197a4e0bf
1 changed files with 6 additions and 4 deletions

View File

@ -724,13 +724,15 @@ void Writer::sortExceptionTable() {
uint8_t *End = Begin + Sec->getVirtualSize();
if (Config->Machine == AMD64) {
struct Entry { ulittle32_t Begin, End, Unwind; };
std::sort((Entry *)Begin, (Entry *)End,
parallel_sort(
(Entry *)Begin, (Entry *)End,
[](const Entry &A, const Entry &B) { return A.Begin < B.Begin; });
return;
}
if (Config->Machine == ARMNT) {
struct Entry { ulittle32_t Begin, Unwind; };
std::sort((Entry *)Begin, (Entry *)End,
parallel_sort(
(Entry *)Begin, (Entry *)End,
[](const Entry &A, const Entry &B) { return A.Begin < B.Begin; });
return;
}