[Openmp-commits] [openmp] 2d6adb3 - [OpenMP] Guard the code if ITT is not used

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Thu Feb 2 19:54:39 PST 2023


Author: Shilei Tian
Date: 2023-02-02T22:54:34-05:00
New Revision: 2d6adb366e8b97988c0b105d4cf61c233ee95c12

URL: https://github.com/llvm/llvm-project/commit/2d6adb366e8b97988c0b105d4cf61c233ee95c12
DIFF: https://github.com/llvm/llvm-project/commit/2d6adb366e8b97988c0b105d4cf61c233ee95c12.diff

LOG: [OpenMP] Guard the code if ITT is not used

`check_loc` is not used if ITT is disabled or debug is off, causing a
compiler warning.

Reviewed By: jlpeyton

Differential Revision: https://reviews.llvm.org/D143004

Added: 
    

Modified: 
    openmp/runtime/src/kmp_sched.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_sched.cpp b/openmp/runtime/src/kmp_sched.cpp
index a5ddb23bf0cd3..53182bef58732 100644
--- a/openmp/runtime/src/kmp_sched.cpp
+++ b/openmp/runtime/src/kmp_sched.cpp
@@ -61,11 +61,13 @@ char const *traits_t<long>::spec = "ld";
 #define KMP_STATS_LOOP_END(stat) /* Nothing */
 #endif
 
+#if USE_ITT_BUILD || defined KMP_DEBUG
 static ident_t loc_stub = {0, KMP_IDENT_KMPC, 0, 0, ";unknown;unknown;0;0;;"};
 static inline void check_loc(ident_t *&loc) {
   if (loc == NULL)
     loc = &loc_stub; // may need to report location info to ittnotify
 }
+#endif
 
 template <typename T>
 static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid,


        


More information about the Openmp-commits mailing list