diff options
author | vvvv <vvvv@ydb.tech> | 2024-02-06 20:01:22 +0300 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-02-09 19:18:27 +0300 |
commit | ee2b7fbda052aa09b6fdb83b8c6f0305fef3e193 (patch) | |
tree | 102765416c3866bde98a82facc7752d329ee0226 /contrib/libs/llvm16/lib/CodeGen/MachineModuleInfoImpls.cpp | |
parent | 7494ca32d3a5aca00b7ac527b5f127989335102c (diff) | |
download | ydb-ee2b7fbda052aa09b6fdb83b8c6f0305fef3e193.tar.gz |
llvm16 targets
Diffstat (limited to 'contrib/libs/llvm16/lib/CodeGen/MachineModuleInfoImpls.cpp')
-rw-r--r-- | contrib/libs/llvm16/lib/CodeGen/MachineModuleInfoImpls.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/contrib/libs/llvm16/lib/CodeGen/MachineModuleInfoImpls.cpp b/contrib/libs/llvm16/lib/CodeGen/MachineModuleInfoImpls.cpp new file mode 100644 index 00000000000..9c3b31935f6 --- /dev/null +++ b/contrib/libs/llvm16/lib/CodeGen/MachineModuleInfoImpls.cpp @@ -0,0 +1,43 @@ +//===- llvm/CodeGen/MachineModuleInfoImpls.cpp ----------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file implements object-file format specific implementations of +// MachineModuleInfoImpl. +// +//===----------------------------------------------------------------------===// + +#include "llvm/CodeGen/MachineModuleInfoImpls.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/MC/MCSymbol.h" + +using namespace llvm; + +//===----------------------------------------------------------------------===// +// MachineModuleInfoMachO +//===----------------------------------------------------------------------===// + +// Out of line virtual method. +void MachineModuleInfoMachO::anchor() {} +void MachineModuleInfoELF::anchor() {} +void MachineModuleInfoCOFF::anchor() {} +void MachineModuleInfoWasm::anchor() {} + +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()); + + array_pod_sort(List.begin(), List.end(), SortSymbolPair); + + Map.clear(); + return List; +} |