@@ -90,14 +90,17 @@ void FailedToMaterialize::log(raw_ostream &OS) const {
90
90
OS << " Failed to materialize symbols: " << *Symbols;
91
91
}
92
92
93
- SymbolsNotFound::SymbolsNotFound (SymbolNameSet Symbols) {
93
+ SymbolsNotFound::SymbolsNotFound (std::shared_ptr<SymbolStringPool> SSP,
94
+ SymbolNameSet Symbols)
95
+ : SSP(std::move(SSP)) {
94
96
for (auto &Sym : Symbols)
95
97
this ->Symbols .push_back (Sym);
96
98
assert (!this ->Symbols .empty () && " Can not fail to resolve an empty set" );
97
99
}
98
100
99
- SymbolsNotFound::SymbolsNotFound (SymbolNameVector Symbols)
100
- : Symbols(std::move(Symbols)) {
101
+ SymbolsNotFound::SymbolsNotFound (std::shared_ptr<SymbolStringPool> SSP,
102
+ SymbolNameVector Symbols)
103
+ : SSP(std::move(SSP)), Symbols(std::move(Symbols)) {
101
104
assert (!this ->Symbols .empty () && " Can not fail to resolve an empty set" );
102
105
}
103
106
@@ -109,8 +112,9 @@ void SymbolsNotFound::log(raw_ostream &OS) const {
109
112
OS << " Symbols not found: " << Symbols;
110
113
}
111
114
112
- SymbolsCouldNotBeRemoved::SymbolsCouldNotBeRemoved (SymbolNameSet Symbols)
113
- : Symbols(std::move(Symbols)) {
115
+ SymbolsCouldNotBeRemoved::SymbolsCouldNotBeRemoved (
116
+ std::shared_ptr<SymbolStringPool> SSP, SymbolNameSet Symbols)
117
+ : SSP(std::move(SSP)), Symbols(std::move(Symbols)) {
114
118
assert (!this ->Symbols .empty () && " Can not fail to resolve an empty set" );
115
119
}
116
120
@@ -1333,11 +1337,13 @@ Error JITDylib::remove(const SymbolNameSet &Names) {
1333
1337
1334
1338
// If any of the symbols are not defined, return an error.
1335
1339
if (!Missing.empty ())
1336
- return make_error<SymbolsNotFound>(std::move (Missing));
1340
+ return make_error<SymbolsNotFound>(ES.getSymbolStringPool (),
1341
+ std::move (Missing));
1337
1342
1338
1343
// If any of the symbols are currently materializing, return an error.
1339
1344
if (!Materializing.empty ())
1340
- return make_error<SymbolsCouldNotBeRemoved>(std::move (Materializing));
1345
+ return make_error<SymbolsCouldNotBeRemoved>(ES.getSymbolStringPool (),
1346
+ std::move (Materializing));
1341
1347
1342
1348
// Remove the symbols.
1343
1349
for (auto &SymbolMaterializerItrPair : SymbolsToRemove) {
@@ -2234,7 +2240,8 @@ Error ExecutionSession::IL_updateCandidatesFor(
2234
2240
// weakly referenced" specific error here to reduce confusion.
2235
2241
if (SymI->second .getFlags ().hasMaterializationSideEffectsOnly () &&
2236
2242
SymLookupFlags != SymbolLookupFlags::WeaklyReferencedSymbol)
2237
- return make_error<SymbolsNotFound>(SymbolNameVector ({Name}));
2243
+ return make_error<SymbolsNotFound>(getSymbolStringPool (),
2244
+ SymbolNameVector ({Name}));
2238
2245
2239
2246
// If we matched against this symbol but it is in the error state
2240
2247
// then bail out and treat it as a failure to materialize.
@@ -2422,7 +2429,7 @@ void ExecutionSession::OL_applyQueryPhase1(
2422
2429
} else {
2423
2430
LLVM_DEBUG (dbgs () << " Phase 1 failed with unresolved symbols.\n " );
2424
2431
IPLS->fail (make_error<SymbolsNotFound>(
2425
- IPLS->DefGeneratorCandidates .getSymbolNames ()));
2432
+ getSymbolStringPool (), IPLS->DefGeneratorCandidates .getSymbolNames ()));
2426
2433
}
2427
2434
}
2428
2435
@@ -2492,7 +2499,8 @@ void ExecutionSession::OL_completeLookup(
2492
2499
dbgs () << " error: "
2493
2500
" required, but symbol is has-side-effects-only\n " ;
2494
2501
});
2495
- return make_error<SymbolsNotFound>(SymbolNameVector ({Name}));
2502
+ return make_error<SymbolsNotFound>(getSymbolStringPool (),
2503
+ SymbolNameVector ({Name}));
2496
2504
}
2497
2505
2498
2506
// If we matched against this symbol but it is in the error state
@@ -2606,7 +2614,8 @@ void ExecutionSession::OL_completeLookup(
2606
2614
2607
2615
if (!IPLS->LookupSet .empty ()) {
2608
2616
LLVM_DEBUG (dbgs () << " Failing due to unresolved symbols\n " );
2609
- return make_error<SymbolsNotFound>(IPLS->LookupSet .getSymbolNames ());
2617
+ return make_error<SymbolsNotFound>(getSymbolStringPool (),
2618
+ IPLS->LookupSet .getSymbolNames ());
2610
2619
}
2611
2620
2612
2621
// Record whether the query completed.
@@ -2733,7 +2742,8 @@ void ExecutionSession::OL_completeLookupFlags(
2733
2742
2734
2743
if (!IPLS->LookupSet .empty ()) {
2735
2744
LLVM_DEBUG (dbgs () << " Failing due to unresolved symbols\n " );
2736
- return make_error<SymbolsNotFound>(IPLS->LookupSet .getSymbolNames ());
2745
+ return make_error<SymbolsNotFound>(getSymbolStringPool (),
2746
+ IPLS->LookupSet .getSymbolNames ());
2737
2747
}
2738
2748
2739
2749
LLVM_DEBUG (dbgs () << " Succeded, result = " << Result << " \n " );
0 commit comments