summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/SymbolSize.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-06-29 16:05:00 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-06-29 16:05:00 +0000
commit025f46f36781901b8fdaa323d54b6554dca05987 (patch)
treec24e45c5e294d4e3623cc903a39351d721a4fe26 /llvm/lib/Object/SymbolSize.cpp
parent1669e68b570ab080e91901f75f4798154fb8e676 (diff)
downloadbcm5719-llvm-025f46f36781901b8fdaa323d54b6554dca05987.tar.gz
bcm5719-llvm-025f46f36781901b8fdaa323d54b6554dca05987.zip
[SymbolSize] Skip sorting by index, just assign by index.
No functional change intended. llvm-svn: 240961
Diffstat (limited to 'llvm/lib/Object/SymbolSize.cpp')
-rw-r--r--llvm/lib/Object/SymbolSize.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Object/SymbolSize.cpp b/llvm/lib/Object/SymbolSize.cpp
index 730e54cf330..1d5cd78e6d9 100644
--- a/llvm/lib/Object/SymbolSize.cpp
+++ b/llvm/lib/Object/SymbolSize.cpp
@@ -31,10 +31,6 @@ static int compareAddress(const SymEntry *A, const SymEntry *B) {
return A->Address - B->Address;
}
-static int compareNumber(const SymEntry *A, const SymEntry *B) {
- return A->Number - B->Number;
-}
-
static unsigned getSectionID(const ObjectFile &O, SectionRef Sec) {
if (auto *M = dyn_cast<MachOObjectFile>(&O))
return M->getSectionID(Sec);
@@ -93,12 +89,12 @@ llvm::object::computeSymbolSizes(const ObjectFile &O) {
P.Address = Size;
}
- // Put back in the original order and copy the result
- array_pod_sort(Addresses.begin(), Addresses.end(), compareNumber);
+ // Assign the sorted symbols in the original order.
+ Ret.resize(SymNum);
for (SymEntry &P : Addresses) {
if (P.I == O.symbol_end())
continue;
- Ret.push_back({*P.I, P.Address});
+ Ret[P.Number] = {*P.I, P.Address};
}
return Ret;
}
OpenPOWER on IntegriCloud