Lines Matching refs:JD

39 ResourceTracker::ResourceTracker(JITDylibSP JD) {  in ResourceTracker()  argument
40 assert((reinterpret_cast<uintptr_t>(JD.get()) & 0x1) == 0 && in ResourceTracker()
42 JD->Retain(); in ResourceTracker()
43 JDAndFlag.store(reinterpret_cast<uintptr_t>(JD.get())); in ResourceTracker()
222 void AsynchronousSymbolQuery::addQueryDependence(JITDylib &JD, in addQueryDependence() argument
224 bool Added = QueryRegistrations[&JD].insert(std::move(Name)).second; in addQueryDependence()
230 JITDylib &JD, const SymbolStringPtr &Name) { in removeQueryDependence() argument
231 auto QRI = QueryRegistrations.find(&JD); in removeQueryDependence()
283 void AbsoluteSymbolsMaterializationUnit::discard(const JITDylib &JD, in discard() argument
475 void ReExportsMaterializationUnit::discard(const JITDylib &JD, in discard() argument
599 JITDylib &JD, in tryToGenerate() argument
602 assert(&JD != &SourceJD && "Cannot re-export from the same dylib"); in tryToGenerate()
605 auto Flags = JD.getExecutionSession().lookupFlags( in tryToGenerate()
620 return JD.define(reexports(SourceJD, AliasMap, SourceJDLookupFlags)); in tryToGenerate()
1207 auto &JD = *Worklist.back().first; in failSymbols() local
1211 (*FailedSymbolsMap)[&JD].insert(Name); in failSymbols()
1214 auto SymI = JD.Symbols.find(Name); in failSymbols()
1220 if (SymI == JD.Symbols.end()) in failSymbols()
1232 auto MII = JD.MaterializingInfos.find(Name); in failSymbols()
1234 if (MII == JD.MaterializingInfos.end()) in failSymbols()
1253 auto UnemittedDepI = DependantMI.UnemittedDependencies.find(&JD); in failSymbols()
1282 assert(UnemittedDepMII->second.Dependants.count(&JD) && in failSymbols()
1284 assert(UnemittedDepMII->second.Dependants[&JD].count(Name) && in failSymbols()
1286 UnemittedDepMII->second.Dependants[&JD].erase(Name); in failSymbols()
1287 if (UnemittedDepMII->second.Dependants[&JD].empty()) in failSymbols()
1288 UnemittedDepMII->second.Dependants.erase(&JD); in failSymbols()
1310 JD.MaterializingInfos.erase(MII); in failSymbols()
1331 void JITDylib::addToLinkOrder(JITDylib &JD, JITDylibLookupFlags JDLookupFlags) { in addToLinkOrder() argument
1332 ES.runSessionLocked([&]() { LinkOrder.push_back({&JD, JDLookupFlags}); }); in addToLinkOrder()
1347 void JITDylib::removeFromLinkOrder(JITDylib &JD) { in removeFromLinkOrder() argument
1352 return KV.first == &JD; in removeFromLinkOrder()
1801 auto *JD = KV.first; in lookupInitSymbols() local
1805 JITDylibSearchOrder({{JD, JITDylibLookupFlags::MatchAllSymbols}}), in lookupInitSymbols()
1807 [&, JD](Expected<SymbolMap> Result) { in lookupInitSymbols()
1812 assert(!CompoundResult.count(JD) && in lookupInitSymbols()
1814 CompoundResult[JD] = std::move(*Result); in lookupInitSymbols()
1863 auto *JD = KV.first; in lookupInitSymbolsAsync() local
1867 JITDylibSearchOrder({{JD, JITDylibLookupFlags::MatchAllSymbols}}), in lookupInitSymbolsAsync()
1906 for (auto &JD : reverse(JITDylibsToClose)) in endSession() local
1907 Err = joinErrors(std::move(Err), JD->clear()); in endSession()
1933 for (auto &JD : JDs) in getJITDylibByName() local
1934 if (JD->getName() == Name) in getJITDylibByName()
1935 return JD.get(); in getJITDylibByName()
1949 auto &JD = createBareJITDylib(Name); in createJITDylib() local
1951 if (auto Err = P->setupJITDylib(JD)) in createJITDylib()
1953 return JD; in createJITDylib()
1956 Error ExecutionSession::removeJITDylib(JITDylib &JD) { in removeJITDylib() argument
1959 JITDylibSP JDKeepAlive = &JD; in removeJITDylib()
1963 assert(JD.State == JITDylib::Open && "JD already closed"); in removeJITDylib()
1964 JD.State = JITDylib::Closing; in removeJITDylib()
1965 auto I = llvm::find(JDs, &JD); in removeJITDylib()
1972 auto Err = JD.clear(); in removeJITDylib()
1976 Err = joinErrors(std::move(Err), P->teardownJITDylib(JD)); in removeJITDylib()
1980 assert(JD.State == JITDylib::Closing && "JD should be closing"); in removeJITDylib()
1981 JD.State = JITDylib::Closed; in removeJITDylib()
1982 assert(JD.Symbols.empty() && "JD.Symbols is not empty after clear"); in removeJITDylib()
1983 assert(JD.UnmaterializedInfos.empty() && in removeJITDylib()
1985 assert(JD.MaterializingInfos.empty() && in removeJITDylib()
1987 assert(JD.TrackerSymbols.empty() && in removeJITDylib()
1989 JD.DefGenerators.clear(); in removeJITDylib()
1990 JD.LinkOrder.clear(); in removeJITDylib()
2005 for (auto &JD : JDs) { in getDFSLinkOrder() local
2007 if (JD->State != Open) in getDFSLinkOrder()
2009 "Error building link order: " + JD->getName() + " is defunct", in getDFSLinkOrder()
2011 if (Visited.count(JD.get())) in getDFSLinkOrder()
2015 WorkStack.push_back(JD); in getDFSLinkOrder()
2016 Visited.insert(JD.get()); in getDFSLinkOrder()
2023 auto &JD = *KV.first; in getDFSLinkOrder() local
2024 if (!Visited.insert(&JD).second) in getDFSLinkOrder()
2026 WorkStack.push_back(&JD); in getDFSLinkOrder()
2186 JITDylib &JD, JITDispatchHandlerAssociationMap WFs) { in registerJITDispatchHandlers() argument
2188 auto TagAddrs = lookup({{&JD, JITDylibLookupFlags::MatchAllSymbols}}, in registerJITDispatchHandlers()
2239 for (auto &JD : JDs) in dump() local
2240 JD->dump(OS); in dump()
2316 auto &JD = DstRT.getJITDylib(); in transferResourceTracker() local
2317 JD.transferTracker(DstRT, SrcRT); in transferResourceTracker()
2336 JITDylib &JD, JITDylibLookupFlags JDLookupFlags, in IL_updateCandidatesFor() argument
2343 auto SymI = JD.Symbols.find(Name); in IL_updateCandidatesFor()
2344 if (SymI == JD.Symbols.end()) in IL_updateCandidatesFor()
2373 (*FailedSymbolsMap)[&JD] = {Name}; in IL_updateCandidatesFor()
2414 auto &JD = *KV.first; in OL_applyQueryPhase1() local
2418 dbgs() << "Visiting \"" << JD.getName() << "\" (" << JDLookupFlags in OL_applyQueryPhase1()
2426 IPLS->GeneratorLock = std::unique_lock<std::mutex>(JD.GeneratorsMutex); in OL_applyQueryPhase1()
2436 dbgs() << " First time visiting " << JD.getName() in OL_applyQueryPhase1()
2442 IPLS->CurDefGeneratorStack.reserve(JD.DefGenerators.size()); in OL_applyQueryPhase1()
2443 for (auto &DG : reverse(JD.DefGenerators)) in OL_applyQueryPhase1()
2458 JD, JDLookupFlags, IPLS->DefGeneratorCandidates, in OL_applyQueryPhase1()
2459 JD.DefGenerators.empty() ? nullptr in OL_applyQueryPhase1()
2501 Err = DG->tryToGenerate(LS, K, JD, JDLookupFlags, LookupSet); in OL_applyQueryPhase1()
2526 JD, JDLookupFlags, IPLS->DefGeneratorCandidates, in OL_applyQueryPhase1()
2527 JD.DefGenerators.empty() ? nullptr in OL_applyQueryPhase1()
2595 auto &JD = *KV.first; in OL_completeLookup() local
2598 dbgs() << "Visiting \"" << JD.getName() << "\" (" << JDLookupFlags in OL_completeLookup()
2612 auto SymI = JD.Symbols.find(Name); in OL_completeLookup()
2613 if (SymI == JD.Symbols.end()) { in OL_completeLookup()
2647 (*FailedSymbolsMap)[&JD] = {Name}; in OL_completeLookup()
2669 auto UMII = JD.UnmaterializedInfos.find(Name); in OL_completeLookup()
2670 assert(UMII != JD.UnmaterializedInfos.end() && in OL_completeLookup()
2684 auto SymK = JD.Symbols.find(KV.first); in OL_completeLookup()
2685 assert(SymK != JD.Symbols.end() && in OL_completeLookup()
2689 JD.UnmaterializedInfos.erase(KV.first); in OL_completeLookup()
2693 CollectedUMIs[&JD].push_back(std::move(UMI)); in OL_completeLookup()
2702 auto &MI = JD.MaterializingInfos[Name]; in OL_completeLookup()
2704 Q->addQueryDependence(JD, Name); in OL_completeLookup()
2721 auto &JD = *KV.first; in OL_completeLookup() local
2724 assert(!JD.UnmaterializedInfos.count(KV2.first) && in OL_completeLookup()
2726 auto SymI = JD.Symbols.find(KV2.first); in OL_completeLookup()
2727 assert(SymI != JD.Symbols.end() && "Missing symbol entry"); in OL_completeLookup()
2733 JD.UnmaterializedInfos[KV2.first] = UMI; in OL_completeLookup()
2772 auto &JD = *KV.first; in OL_completeLookup()
2773 dbgs() << " For " << JD.getName() << ": Adding " << KV.second.size() in OL_completeLookup()
2833 auto &JD = *KV.first; in OL_completeLookupFlags() local
2836 dbgs() << "Visiting \"" << JD.getName() << "\" (" << JDLookupFlags in OL_completeLookupFlags()
2849 auto SymI = JD.Symbols.find(Name); in OL_completeLookupFlags()
2850 if (SymI == JD.Symbols.end()) { in OL_completeLookupFlags()
2897 MR.JD.unlinkMaterializationResponsibility(MR); in OL_destroyMaterializationResponsibility()
2902 return MR.JD.getRequestedSymbols(MR.SymbolFlags); in OL_getRequestedSymbols()
2908 dbgs() << "In " << MR.JD.getName() << " resolving " << Symbols << "\n"; in OL_notifyResolved()
2923 return MR.JD.resolve(MR, Symbols); in OL_notifyResolved()
2928 dbgs() << "In " << MR.JD.getName() << " emitting " << MR.SymbolFlags in OL_notifyEmitted()
2932 if (auto Err = MR.JD.emit(MR, MR.SymbolFlags)) in OL_notifyEmitted()
2943 dbgs() << "In " << MR.JD.getName() << " defining materializing symbols " in OL_defineMaterializing()
2947 MR.JD.defineMaterializing(std::move(NewSymbolFlags))) { in OL_defineMaterializing()
2959 dbgs() << "In " << MR.JD.getName() << " failing materialization for " in OL_notifyFailed()
2966 Worklist.push_back(std::make_pair(&MR.JD, KV.first)); in OL_notifyFailed()
3000 LLVM_DEBUG(MR.JD.getExecutionSession().runSessionLocked([&]() { in OL_replace()
3001 dbgs() << "In " << MR.JD.getName() << " replacing symbols with " << *MU in OL_replace()
3005 return MR.JD.replace(MR, std::move(MU)); in OL_replace()
3028 return MR.JD.delegate(MR, std::move(DelegatedFlags), in OL_delegate()
3041 MR.JD.addDependencies(Name, Dependencies); in OL_addDependencies()
3052 MR.JD.addDependencies(KV.first, Dependencies); in OL_addDependenciesForAll()