File tree 4 files changed +16
-10
lines changed
include/llvm/ExecutionEngine/JITLink
lib/ExecutionEngine/JITLink
test/ExecutionEngine/JITLink/x86-64
4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 15
15
16
16
#include " llvm/ADT/DenseMap.h"
17
17
#include " llvm/ADT/DenseSet.h"
18
- #include " llvm/ADT/MapVector.h"
19
18
#include " llvm/ADT/FunctionExtras.h"
20
19
#include " llvm/ADT/STLExtras.h"
21
20
#include " llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
@@ -854,7 +853,7 @@ class SectionRange {
854
853
855
854
class LinkGraph {
856
855
private:
857
- using SectionMap = MapVector <StringRef, std::unique_ptr<Section>>;
856
+ using SectionMap = DenseMap <StringRef, std::unique_ptr<Section>>;
858
857
using ExternalSymbolMap = StringMap<Symbol *>;
859
858
using AbsoluteSymbolSet = DenseSet<Symbol *>;
860
859
using BlockSet = DenseSet<Block *>;
@@ -1596,7 +1595,7 @@ class LinkGraph {
1596
1595
unsigned PointerSize;
1597
1596
llvm::endianness Endianness;
1598
1597
GetEdgeKindNameFunction GetEdgeKindName = nullptr ;
1599
- MapVector <StringRef, std::unique_ptr<Section>> Sections;
1598
+ DenseMap <StringRef, std::unique_ptr<Section>> Sections;
1600
1599
ExternalSymbolMap ExternalSymbols;
1601
1600
AbsoluteSymbolSet AbsoluteSymbols;
1602
1601
orc::shared::AllocActions AAs;
Original file line number Diff line number Diff line change @@ -291,11 +291,18 @@ void LinkGraph::dump(raw_ostream &OS) {
291
291
return false ;
292
292
});
293
293
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 " ;
296
303
297
304
std::vector<Block *> SortedBlocks;
298
- llvm::copy (Sec. blocks (), std::back_inserter (SortedBlocks));
305
+ llvm::copy (Sec-> blocks (), std::back_inserter (SortedBlocks));
299
306
llvm::sort (SortedBlocks, [](const Block *LHS, const Block *RHS) {
300
307
return LHS->getAddress () < RHS->getAddress ();
301
308
});
Original file line number Diff line number Diff line change 7
7
# parent block is dead.
8
8
#
9
9
# CHECK: Link graph
10
- # CHECK-DAG: section parent:
11
- # CHECK-EMPTY:
12
10
# CHECK-DAG: section child:
13
11
# CHECK-EMPTY:
12
+ # CHECK-DAG: section parent:
13
+ # CHECK-EMPTY:
14
14
15
15
--- !COFF
16
16
header:
Original file line number Diff line number Diff line change 8
8
#
9
9
# CHECK: section .func:
10
10
# CHECK-EMPTY:
11
- # CHECK-NEXT: section .xdata:
12
- # CHECK-EMPTY:
13
11
# CHECK-NEXT: section .pdata:
12
+ # CHECK-EMPTY:
13
+ # CHECK: section .xdata:
14
14
# CHECK-EMPTY:
15
15
16
16
.text
You can’t perform that action at this time.
0 commit comments