diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2024-07-27 23:34:35 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2024-10-23 18:26:01 +0000 |
commit | 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583 (patch) | |
tree | 6cf5ab1f05330c6773b1f3f64799d56a9c7a1faa /contrib/llvm-project/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp | |
parent | 6b9f7133aba44189d9625c352bc2c2a59baf18ef (diff) | |
parent | ac9a064cb179f3425b310fa2847f8764ac970a4d (diff) |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp b/contrib/llvm-project/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp index 9c3b31935f6d..956317510dc7 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp @@ -13,6 +13,7 @@ #include "llvm/CodeGen/MachineModuleInfoImpls.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/MC/MCSymbol.h" using namespace llvm; @@ -41,3 +42,20 @@ MachineModuleInfoImpl::SymbolListTy MachineModuleInfoImpl::getSortedStubs( Map.clear(); return List; } + +using ExprStubPairTy = std::pair<MCSymbol *, const MCExpr *>; +static int SortAuthStubPair(const ExprStubPairTy *LHS, + const ExprStubPairTy *RHS) { + return LHS->first->getName().compare(RHS->first->getName()); +} + +MachineModuleInfoImpl::ExprStubListTy MachineModuleInfoImpl::getSortedExprStubs( + DenseMap<MCSymbol *, const MCExpr *> &ExprStubs) { + MachineModuleInfoImpl::ExprStubListTy List(ExprStubs.begin(), + ExprStubs.end()); + + array_pod_sort(List.begin(), List.end(), SortAuthStubPair); + + ExprStubs.clear(); + return List; +} |