LLVM  14.0.0git
MachineModuleInfoImpls.cpp
Go to the documentation of this file.
1 //===- llvm/CodeGen/MachineModuleInfoImpls.cpp ----------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements object-file format specific implementations of
10 // MachineModuleInfoImpl.
11 //
12 //===----------------------------------------------------------------------===//
13 
15 #include "llvm/ADT/DenseMap.h"
16 #include "llvm/MC/MCSymbol.h"
17 
18 using namespace llvm;
19 
20 //===----------------------------------------------------------------------===//
21 // MachineModuleInfoMachO
22 //===----------------------------------------------------------------------===//
23 
24 // Out of line virtual method.
25 void MachineModuleInfoMachO::anchor() {}
26 void MachineModuleInfoELF::anchor() {}
27 void MachineModuleInfoCOFF::anchor() {}
28 void MachineModuleInfoWasm::anchor() {}
29 
30 using PairTy = std::pair<MCSymbol *, MachineModuleInfoImpl::StubValueTy>;
31 static int SortSymbolPair(const PairTy *LHS, const PairTy *RHS) {
32  return LHS->first->getName().compare(RHS->first->getName());
33 }
34 
37  MachineModuleInfoImpl::SymbolListTy List(Map.begin(), Map.end());
38 
39  array_pod_sort(List.begin(), List.end(), SortSymbolPair);
40 
41  Map.clear();
42  return List;
43 }
llvm::array_pod_sort
void array_pod_sort(IteratorTy Start, IteratorTy End)
array_pod_sort - This sorts an array with the specified start and end extent.
Definition: STLExtras.h:1446
MachineModuleInfoImpls.h
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
PairTy
std::pair< MCSymbol *, MachineModuleInfoImpl::StubValueTy > PairTy
Definition: MachineModuleInfoImpls.cpp:30
llvm::MachineModuleInfoImpl::SymbolListTy
std::vector< std::pair< MCSymbol *, StubValueTy > > SymbolListTy
Definition: MachineModuleInfo.h:63
DenseMap.h
SortSymbolPair
static int SortSymbolPair(const PairTy *LHS, const PairTy *RHS)
Definition: MachineModuleInfoImpls.cpp:31
MCSymbol.h
llvm::MachineModuleInfoImpl::getSortedStubs
static SymbolListTy getSortedStubs(DenseMap< MCSymbol *, StubValueTy > &)
Return the entries from a DenseMap in a deterministic sorted orer.
Definition: MachineModuleInfoImpls.cpp:35
llvm::DenseMap
Definition: DenseMap.h:714
List
const NodeList & List
Definition: RDFGraph.cpp:201