File tree Expand file tree Collapse file tree 4 files changed +10
-16
lines changed
include/llvm/ExecutionEngine/JITLink
lib/ExecutionEngine/JITLink
test/ExecutionEngine/JITLink/x86-64 Expand file tree Collapse file tree 4 files changed +10
-16
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"
1819#include " llvm/ADT/FunctionExtras.h"
1920#include " llvm/ADT/STLExtras.h"
2021#include " llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
@@ -853,7 +854,7 @@ class SectionRange {
853854
854855class LinkGraph {
855856private:
856- using SectionMap = DenseMap <StringRef, std::unique_ptr<Section>>;
857+ using SectionMap = MapVector <StringRef, std::unique_ptr<Section>>;
857858 using ExternalSymbolMap = StringMap<Symbol *>;
858859 using AbsoluteSymbolSet = DenseSet<Symbol *>;
859860 using BlockSet = DenseSet<Block *>;
@@ -1595,7 +1596,7 @@ class LinkGraph {
15951596 unsigned PointerSize;
15961597 llvm::endianness Endianness;
15971598 GetEdgeKindNameFunction GetEdgeKindName = nullptr ;
1598- DenseMap <StringRef, std::unique_ptr<Section>> Sections;
1599+ MapVector <StringRef, std::unique_ptr<Section>> Sections;
15991600 ExternalSymbolMap ExternalSymbols;
16001601 AbsoluteSymbolSet AbsoluteSymbols;
16011602 orc::shared::AllocActions AAs;
Original file line number Diff line number Diff line change @@ -291,18 +291,11 @@ void LinkGraph::dump(raw_ostream &OS) {
291291 return false ;
292292 });
293293
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 " ;
294+ for (auto &Sec : sections ()) {
295+ OS << " section " << Sec.getName () << " :\n\n " ;
303296
304297 std::vector<Block *> SortedBlocks;
305- llvm::copy (Sec-> blocks (), std::back_inserter (SortedBlocks));
298+ llvm::copy (Sec. blocks (), std::back_inserter (SortedBlocks));
306299 llvm::sort (SortedBlocks, [](const Block *LHS, const Block *RHS) {
307300 return LHS->getAddress () < RHS->getAddress ();
308301 });
Original file line number Diff line number Diff line change 77# parent block is dead.
88#
99# CHECK: Link graph
10- # CHECK-DAG: section child:
11- # CHECK-EMPTY:
1210# CHECK-DAG: section parent:
1311# CHECK-EMPTY:
12+ # CHECK-DAG: section child:
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 .pdata :
11+ # CHECK-NEXT: section .xdata :
1212# CHECK-EMPTY:
13- # CHECK: section .xdata :
13+ # CHECK-NEXT : section .pdata :
1414# CHECK-EMPTY:
1515
1616 .text
You can’t perform that action at this time.
0 commit comments