@@ -895,8 +895,8 @@ void JITDylib::replace(std::unique_ptr<MaterializationUnit> MU) {
895
895
for (auto &KV : MU->getSymbols ()) {
896
896
auto SymI = Symbols.find (KV.first );
897
897
assert (SymI != Symbols.end () && " Replacing unknown symbol" );
898
- assert (SymI->second .isInMaterializationPhase () &&
899
- " Can not call replace on a symbol that is not materializing" );
898
+ assert (SymI->second .getState () == SymbolState::Materializing &&
899
+ " Can not replace a symbol that ha is not materializing" );
900
900
assert (!SymI->second .hasMaterializerAttached () &&
901
901
" Symbol should not have materializer attached already" );
902
902
assert (UnmaterializedInfos.count (KV.first ) == 0 &&
@@ -943,7 +943,9 @@ JITDylib::getRequestedSymbols(const SymbolFlagsMap &SymbolFlags) const {
943
943
944
944
for (auto &KV : SymbolFlags) {
945
945
assert (Symbols.count (KV.first ) && " JITDylib does not cover this symbol?" );
946
- assert (Symbols.find (KV.first )->second .isInMaterializationPhase () &&
946
+ assert (Symbols.find (KV.first )->second .getState () !=
947
+ SymbolState::NeverSearched &&
948
+ Symbols.find (KV.first )->second .getState () != SymbolState::Ready &&
947
949
" getRequestedSymbols can only be called for symbols that have "
948
950
" started materializing" );
949
951
auto I = MaterializingInfos.find (KV.first );
@@ -961,7 +963,7 @@ JITDylib::getRequestedSymbols(const SymbolFlagsMap &SymbolFlags) const {
961
963
void JITDylib::addDependencies (const SymbolStringPtr &Name,
962
964
const SymbolDependenceMap &Dependencies) {
963
965
assert (Symbols.count (Name) && " Name not in symbol table" );
964
- assert (Symbols[Name].isInMaterializationPhase () &&
966
+ assert (Symbols[Name].getState () < SymbolState::Emitted &&
965
967
" Can not add dependencies for a symbol that is not materializing" );
966
968
967
969
LLVM_DEBUG ({
@@ -1432,7 +1434,8 @@ Error JITDylib::remove(const SymbolNameSet &Names) {
1432
1434
}
1433
1435
1434
1436
// Note symbol materializing.
1435
- if (I->second .isInMaterializationPhase ()) {
1437
+ if (I->second .getState () != SymbolState::NeverSearched &&
1438
+ I->second .getState () != SymbolState::Ready) {
1436
1439
Materializing.insert (Name);
1437
1440
continue ;
1438
1441
}
@@ -1600,7 +1603,8 @@ Error JITDylib::lodgeQueryImpl(MaterializationUnitList &MUs,
1600
1603
1601
1604
// Add the query to the PendingQueries list and continue, deleting the
1602
1605
// element.
1603
- assert (SymI->second .isInMaterializationPhase () &&
1606
+ assert (SymI->second .getState () != SymbolState::NeverSearched &&
1607
+ SymI->second .getState () != SymbolState::Ready &&
1604
1608
" By this line the symbol should be materializing" );
1605
1609
auto &MI = MaterializingInfos[Name];
1606
1610
MI.addQuery (Q);
@@ -1720,7 +1724,8 @@ bool JITDylib::lookupImpl(
1720
1724
}
1721
1725
1722
1726
// Add the query to the PendingQueries list.
1723
- assert (SymI->second .isInMaterializationPhase () &&
1727
+ assert (SymI->second .getState () != SymbolState::NeverSearched &&
1728
+ SymI->second .getState () != SymbolState::Ready &&
1724
1729
" By this line the symbol should be materializing" );
1725
1730
auto &MI = MaterializingInfos[Name];
1726
1731
MI.addQuery (Q);
0 commit comments