Skip to content

Commit

Permalink
[OpenMP][NFC] Minor name and code simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
jdoerfert committed Nov 27, 2023
1 parent 2b2e711 commit f943646
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions openmp/libomptarget/include/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,14 +624,11 @@ struct PluginManager {
// Work around for plugins that call dlopen on shared libraries that call
// tgt_register_lib during their initialisation. Stash the pointers in a
// vector until the plugins are all initialised and then register them.
bool maybeDelayRegisterLib(__tgt_bin_desc *Desc) {
if (!RTLsLoaded) {
// Only reachable from libomptarget constructor
DelayedBinDesc.push_back(Desc);
return true;
} else {
bool delayRegisterLib(__tgt_bin_desc *Desc) {
if (RTLsLoaded)
return false;
}
DelayedBinDesc.push_back(Desc);
return true;
}

void registerDelayedLibraries() {
Expand Down
2 changes: 1 addition & 1 deletion openmp/libomptarget/src/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ EXTERN void __tgt_register_requires(int64_t Flags) {
/// adds a target shared library to the target execution image
EXTERN void __tgt_register_lib(__tgt_bin_desc *Desc) {
TIMESCOPE();
if (PM->maybeDelayRegisterLib(Desc))
if (PM->delayRegisterLib(Desc))
return;

PM->RTLs.registerLib(Desc);
Expand Down

0 comments on commit f943646

Please sign in to comment.