File tree Expand file tree Collapse file tree 4 files changed +16
-10
lines changed
include/llvm/ExecutionEngine/JITLink
lib/ExecutionEngine/JITLink
test/ExecutionEngine/JITLink/x86-64 Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 1515
1616#include " llvm/ADT/DenseMap.h"
1717#include " llvm/ADT/DenseSet.h"
18- #include " llvm/ADT/MapVector.h"
1918#include " llvm/ADT/FunctionExtras.h"
2019#include " llvm/ADT/STLExtras.h"
2120#include " llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
@@ -854,7 +853,7 @@ class SectionRange {
854853
855854class LinkGraph {
856855private:
857- using SectionMap = MapVector <StringRef, std::unique_ptr<Section>>;
856+ using SectionMap = DenseMap <StringRef, std::unique_ptr<Section>>;
858857 using ExternalSymbolMap = StringMap<Symbol *>;
859858 using AbsoluteSymbolSet = DenseSet<Symbol *>;
860859 using BlockSet = DenseSet<Block *>;
@@ -1596,7 +1595,7 @@ class LinkGraph {
15961595 unsigned PointerSize;
15971596 llvm::endianness Endianness;
15981597 GetEdgeKindNameFunction GetEdgeKindName = nullptr ;
1599- MapVector <StringRef, std::unique_ptr<Section>> Sections;
1598+ DenseMap <StringRef, std::unique_ptr<Section>> Sections;
16001599 ExternalSymbolMap ExternalSymbols;
16011600 AbsoluteSymbolSet AbsoluteSymbols;
16021601 orc::shared::AllocActions AAs;
Original file line number Diff line number Diff line change @@ -291,11 +291,18 @@ void LinkGraph::dump(raw_ostream &OS) {
291291 return false ;
292292 });
293293
294- for (auto &Sec : sections ()) {
295- OS << " section " << Sec.getName () << " :\n\n " ;
294+ std::vector<Section *> SortedSections;
295+ for (auto &Sec : sections ())
296+ SortedSections.push_back (&Sec);
297+ llvm::sort (SortedSections, [](const Section *LHS, const Section *RHS) {
298+ return LHS->getName () < RHS->getName ();
299+ });
300+
301+ for (auto *Sec : SortedSections) {
302+ OS << " section " << Sec->getName () << " :\n\n " ;
296303
297304 std::vector<Block *> SortedBlocks;
298- llvm::copy (Sec. blocks (), std::back_inserter (SortedBlocks));
305+ llvm::copy (Sec-> blocks (), std::back_inserter (SortedBlocks));
299306 llvm::sort (SortedBlocks, [](const Block *LHS, const Block *RHS) {
300307 return LHS->getAddress () < RHS->getAddress ();
301308 });
Original file line number Diff line number Diff line change 77# parent block is dead.
88#
99# CHECK: Link graph
10- # CHECK-DAG: section parent:
11- # CHECK-EMPTY:
1210# CHECK-DAG: section child:
1311# CHECK-EMPTY:
12+ # CHECK-DAG: section parent:
13+ # CHECK-EMPTY:
1414
1515--- !COFF
1616header:
Original file line number Diff line number Diff line change 88#
99# CHECK: section .func:
1010# CHECK-EMPTY:
11- # CHECK-NEXT: section .xdata:
12- # CHECK-EMPTY:
1311# CHECK-NEXT: section .pdata:
12+ # CHECK-EMPTY:
13+ # CHECK: section .xdata:
1414# CHECK-EMPTY:
1515
1616 .text
You can’t perform that action at this time.
0 commit comments