[PATCH] D39214: [MachineModuleInfoImpls] Replace qsort with array_pod_sort
Benjamin Kramer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 26 00:30:11 PDT 2017
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.
Looks good, thanks!
================
Comment at: lib/CodeGen/MachineModuleInfoImpls.cpp:29
-static int SortSymbolPair(const void *LHS, const void *RHS) {
- using PairTy = std::pair<MCSymbol *, MachineModuleInfoImpl::StubValueTy>;
-
- 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) {
----------------
Any reason for moving this using decl out of the function?
================
Comment at: lib/CodeGen/MachineModuleInfoImpls.cpp:38
if (!List.empty())
+ array_pod_sort(List.begin(), List.end(), SortSymbolPair);
----------------
Nit: array_pod_sort checks for empty, so this if isn't necessary anymore.
Repository:
rL LLVM
https://reviews.llvm.org/D39214
More information about the llvm-commits
mailing list