[Openmp-commits] [openmp] f943646 - [OpenMP][NFC] Minor name and code simplification
Johannes Doerfert via Openmp-commits
openmp-commits at lists.llvm.org
Mon Nov 27 11:09:37 PST 2023
Author: Johannes Doerfert
Date: 2023-11-27T11:08:29-08:00
New Revision: f9436464a9c8ecae8e7eac5be788bc48041b19b4
URL: https://github.com/llvm/llvm-project/commit/f9436464a9c8ecae8e7eac5be788bc48041b19b4
DIFF: https://github.com/llvm/llvm-project/commit/f9436464a9c8ecae8e7eac5be788bc48041b19b4.diff
LOG: [OpenMP][NFC] Minor name and code simplification
Added:
Modified:
openmp/libomptarget/include/device.h
openmp/libomptarget/src/interface.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/include/device.h b/openmp/libomptarget/include/device.h
index cd76d88618be4ee..74b59a4ab367c75 100644
--- a/openmp/libomptarget/include/device.h
+++ b/openmp/libomptarget/include/device.h
@@ -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() {
diff --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp
index 175b1e2b148bf7d..ae9d1c597e15940 100644
--- a/openmp/libomptarget/src/interface.cpp
+++ b/openmp/libomptarget/src/interface.cpp
@@ -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);
More information about the Openmp-commits
mailing list