Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Differential D131510 Diff 451200 llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | #else | ||||
return make_error<StringError>( | return make_error<StringError>( | ||||
"SharedMemoryMapper is not supported on this platform yet", | "SharedMemoryMapper is not supported on this platform yet", | ||||
inconvertibleErrorCode()); | inconvertibleErrorCode()); | ||||
#endif | #endif | ||||
} | } | ||||
Error ExecutorSharedMemoryMapperService::shutdown() { | Error ExecutorSharedMemoryMapperService::shutdown() { | ||||
std::vector<ExecutorAddr> ReservationAddrs; | std::vector<ExecutorAddr> ReservationAddrs; | ||||
if (!Reservations.empty()) { | |||||
std::lock_guard<std::mutex> Lock(Mutex); | |||||
{ | { | ||||
std::lock_guard<std::mutex> Lock(Mutex); | |||||
if (Reservations.empty()) | |||||
return Error::success(); | |||||
ReservationAddrs.reserve(Reservations.size()); | ReservationAddrs.reserve(Reservations.size()); | ||||
for (const auto &R : Reservations) { | for (const auto &R : Reservations) { | ||||
ReservationAddrs.push_back(ExecutorAddr::fromPtr(R.getFirst())); | ReservationAddrs.push_back(ExecutorAddr::fromPtr(R.getFirst())); | ||||
} | } | ||||
Reservations.clear(); | |||||
} | } | ||||
} | |||||
return release(ReservationAddrs); | |||||
return Error::success(); | return release(ReservationAddrs); | ||||
} | } | ||||
void ExecutorSharedMemoryMapperService::addBootstrapSymbols( | void ExecutorSharedMemoryMapperService::addBootstrapSymbols( | ||||
StringMap<ExecutorAddr> &M) { | StringMap<ExecutorAddr> &M) { | ||||
M[rt::ExecutorSharedMemoryMapperServiceInstanceName] = | M[rt::ExecutorSharedMemoryMapperServiceInstanceName] = | ||||
ExecutorAddr::fromPtr(this); | ExecutorAddr::fromPtr(this); | ||||
M[rt::ExecutorSharedMemoryMapperServiceReserveWrapperName] = | M[rt::ExecutorSharedMemoryMapperServiceReserveWrapperName] = | ||||
ExecutorAddr::fromPtr(&reserveWrapper); | ExecutorAddr::fromPtr(&reserveWrapper); | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |