Skip to content

Commit f943646

Browse files
committed
[OpenMP][NFC] Minor name and code simplification
1 parent 2b2e711 commit f943646

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

openmp/libomptarget/include/device.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -624,14 +624,11 @@ struct PluginManager {
624624
// Work around for plugins that call dlopen on shared libraries that call
625625
// tgt_register_lib during their initialisation. Stash the pointers in a
626626
// vector until the plugins are all initialised and then register them.
627-
bool maybeDelayRegisterLib(__tgt_bin_desc *Desc) {
628-
if (!RTLsLoaded) {
629-
// Only reachable from libomptarget constructor
630-
DelayedBinDesc.push_back(Desc);
631-
return true;
632-
} else {
627+
bool delayRegisterLib(__tgt_bin_desc *Desc) {
628+
if (RTLsLoaded)
633629
return false;
634-
}
630+
DelayedBinDesc.push_back(Desc);
631+
return true;
635632
}
636633

637634
void registerDelayedLibraries() {

openmp/libomptarget/src/interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ EXTERN void __tgt_register_requires(int64_t Flags) {
4242
/// adds a target shared library to the target execution image
4343
EXTERN void __tgt_register_lib(__tgt_bin_desc *Desc) {
4444
TIMESCOPE();
45-
if (PM->maybeDelayRegisterLib(Desc))
45+
if (PM->delayRegisterLib(Desc))
4646
return;
4747

4848
PM->RTLs.registerLib(Desc);

0 commit comments

Comments
 (0)