Skip to content

Commit 42a193c

Browse files
committed
Refactor dlupdate to remove the mode argument
1 parent 1b8dc2d commit 42a193c

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

compiler-rt/lib/orc/elfnix_platform.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class ELFNixPlatformRuntimeState {
105105

106106
const char *dlerror();
107107
void *dlopen(std::string_view Name, int Mode);
108-
int dlupdate(void *DSOHandle, int Mode);
108+
int dlupdate(void *DSOHandle);
109109
int dlclose(void *DSOHandle);
110110
void *dlsym(void *DSOHandle, std::string_view Symbol);
111111

@@ -137,7 +137,7 @@ class ELFNixPlatformRuntimeState {
137137
Error dlopenInitialize(std::unique_lock<std::recursive_mutex> &JDStatesLock,
138138
PerJITDylibState &JDS,
139139
ELFNixJITDylibDepInfoMap &DepInfo);
140-
Error dlupdateImpl(void *DSOHandle, int Mode);
140+
Error dlupdateImpl(void *DSOHandle);
141141
Error dlupdateFull(std::unique_lock<std::recursive_mutex> &JDStatesLock,
142142
PerJITDylibState &JDS);
143143

@@ -314,8 +314,8 @@ void *ELFNixPlatformRuntimeState::dlopen(std::string_view Path, int Mode) {
314314
}
315315
}
316316

317-
int ELFNixPlatformRuntimeState::dlupdate(void *DSOHandle, int Mode) {
318-
if (auto Err = dlupdateImpl(DSOHandle, Mode)) {
317+
int ELFNixPlatformRuntimeState::dlupdate(void *DSOHandle) {
318+
if (auto Err = dlupdateImpl(DSOHandle)) {
319319
// FIXME: Make dlerror thread safe.
320320
DLFcnError = toString(std::move(Err));
321321
return -1;
@@ -537,7 +537,7 @@ Error ELFNixPlatformRuntimeState::dlopenInitialize(
537537
return Error::success();
538538
}
539539

540-
Error ELFNixPlatformRuntimeState::dlupdateImpl(void *DSOHandle, int Mode) {
540+
Error ELFNixPlatformRuntimeState::dlupdateImpl(void *DSOHandle) {
541541
std::unique_lock<std::recursive_mutex> Lock(JDStatesMutex);
542542

543543
// Try to find JITDylib state by name.
@@ -823,8 +823,8 @@ void *__orc_rt_elfnix_jit_dlopen(const char *path, int mode) {
823823
return ELFNixPlatformRuntimeState::get().dlopen(path, mode);
824824
}
825825

826-
int __orc_rt_elfnix_jit_dlupdate(void *dso_handle, int mode) {
827-
return ELFNixPlatformRuntimeState::get().dlupdate(dso_handle, mode);
826+
int __orc_rt_elfnix_jit_dlupdate(void *dso_handle) {
827+
return ELFNixPlatformRuntimeState::get().dlupdate(dso_handle);
828828
}
829829

830830
int __orc_rt_elfnix_jit_dlclose(void *dso_handle) {

compiler-rt/lib/orc/elfnix_platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ORC_RT_INTERFACE void __orc_rt_elfnix_cxa_finalize(void *dso_handle);
2525
// dlfcn functions.
2626
ORC_RT_INTERFACE const char *__orc_rt_elfnix_jit_dlerror();
2727
ORC_RT_INTERFACE void *__orc_rt_elfnix_jit_dlopen(const char *path, int mode);
28-
ORC_RT_INTERFACE int __orc_rt_elfnix_jit_dlupdate(void *dso_handle, int mode);
28+
ORC_RT_INTERFACE int __orc_rt_elfnix_jit_dlupdate(void *dso_handle);
2929
ORC_RT_INTERFACE int __orc_rt_elfnix_jit_dlclose(void *dso_handle);
3030
ORC_RT_INTERFACE void *__orc_rt_elfnix_jit_dlsym(void *dso_handle,
3131
const char *symbol);

llvm/lib/ExecutionEngine/Orc/LLJIT.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,7 @@ Error ORCPlatformSupport::initialize(orc::JITDylib &JD) {
636636
int32_t result;
637637
auto E = ES.callSPSWrapper<SPSDLUpdateSig>(WrapperAddr->getAddress(),
638638
result, DSOHandles[&JD]);
639-
if (E)
640-
return E;
641-
else if (result)
639+
if (result)
642640
return make_error<StringError>("dlupdate failed",
643641
inconvertibleErrorCode());
644642
return E;

0 commit comments

Comments
 (0)