summaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-20 14:16:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-20 14:16:56 +0000
commit2cab237b5dbfe1b3e9c7aa7a3c02d2b98fcf7462 (patch)
tree524fe828571f81358bba62fdb6d04c6e5e96a2a4 /contrib/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp
parent6c7828a2807ea5e50c79ca42dbedf2b589ce63b2 (diff)
parent044eb2f6afba375a914ac9d8024f8f5142bb912e (diff)
Notes
Diffstat (limited to 'contrib/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp')
-rw-r--r--contrib/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/contrib/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp b/contrib/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp
index 22d519e5d88f..07b173bc94f8 100644
--- a/contrib/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp
+++ b/contrib/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp
@@ -1,4 +1,4 @@
-//===-- llvm/CodeGen/MachineModuleInfoImpls.cpp ---------------------------===//
+//===- llvm/CodeGen/MachineModuleInfoImpls.cpp ----------------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -13,7 +13,9 @@
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
+#include "llvm/ADT/DenseMap.h"
#include "llvm/MC/MCSymbol.h"
+
using namespace llvm;
//===----------------------------------------------------------------------===//
@@ -24,21 +26,17 @@ using namespace llvm;
void MachineModuleInfoMachO::anchor() {}
void MachineModuleInfoELF::anchor() {}
-static int SortSymbolPair(const void *LHS, const void *RHS) {
- typedef std::pair<MCSymbol*, MachineModuleInfoImpl::StubValueTy> PairTy;
- const MCSymbol *LHSS = ((const PairTy *)LHS)->first;
- const MCSymbol *RHSS = ((const PairTy *)RHS)->first;
- return LHSS->getName().compare(RHSS->getName());
+using PairTy = std::pair<MCSymbol *, MachineModuleInfoImpl::StubValueTy>;
+static int SortSymbolPair(const PairTy *LHS, const PairTy *RHS) {
+ return LHS->first->getName().compare(RHS->first->getName());
}
MachineModuleInfoImpl::SymbolListTy MachineModuleInfoImpl::getSortedStubs(
DenseMap<MCSymbol *, MachineModuleInfoImpl::StubValueTy> &Map) {
MachineModuleInfoImpl::SymbolListTy List(Map.begin(), Map.end());
- if (!List.empty())
- qsort(&List[0], List.size(), sizeof(List[0]), SortSymbolPair);
+ array_pod_sort(List.begin(), List.end(), SortSymbolPair);
Map.clear();
return List;
}
-