[Openmp-commits] [PATCH] D95485: [OpenMP] libomp: fix clang-cl build for vs2019

Andrey Churbanov via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 27 01:19:29 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG498c4b6fc45a: [OpenMP] libomp: fix build by clang-cl with vs2019 (authored by AndreyChurbanov).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95485/new/

https://reviews.llvm.org/D95485

Files:
  openmp/runtime/src/z_Windows_NT_util.cpp


Index: openmp/runtime/src/z_Windows_NT_util.cpp
===================================================================
--- openmp/runtime/src/z_Windows_NT_util.cpp
+++ openmp/runtime/src/z_Windows_NT_util.cpp
@@ -239,9 +239,10 @@
       old_f = flag->unset_sleeping();
       KMP_DEBUG_ASSERT(old_f & KMP_BARRIER_SLEEP_STATE);
       TCW_PTR(th->th.th_sleep_loc, NULL);
-      KF_TRACE(50, ("__kmp_win32_cond_wait: exiting, condition "
-                    "fulfilled: flag's loc(%p): %u => %u\n",
-                    flag->get(), old_f, *(flag->get())));
+      KF_TRACE(50,
+               ("__kmp_win32_cond_wait: exiting, condition "
+                "fulfilled: flag's loc(%p): %u => %u\n",
+                flag->get(), (unsigned int)old_f, (unsigned int)flag->load()));
 
       __kmp_win32_mutex_lock(&cv->waiters_count_lock_);
       KMP_DEBUG_ASSERT(cv->waiters_count_ > 0);
@@ -380,8 +381,8 @@
   }
 
   KF_TRACE(5, ("__kmp_suspend_template: T#%d set sleep bit for flag's"
-               " loc(%p)==%d\n",
-               th_gtid, flag->get(), *(flag->get())));
+               " loc(%p)==%u\n",
+               th_gtid, flag->get(), (unsigned int)flag->load()));
 
   if (flag->done_check_val(old_spin)) {
     old_spin = flag->unset_sleeping();
@@ -493,7 +494,8 @@
     if (!flag->is_sleeping_val(old_spin)) {
       KF_TRACE(5, ("__kmp_resume_template: T#%d exiting, thread T#%d already "
                    "awake: flag's loc(%p): %u => %u\n",
-                   gtid, target_gtid, flag->get(), old_spin, *(flag->get())));
+                   gtid, target_gtid, flag->get(), (unsigned int)old_spin,
+                   (unsigned int)flag->load()));
       __kmp_unlock_suspend_mx(th);
       return;
     }
@@ -591,7 +593,8 @@
 }
 
 void __kmp_affinity_determine_capable(const char *env_var) {
-// All versions of Windows* OS (since Win '95) support SetThreadAffinityMask().
+  // All versions of Windows* OS (since Win '95) support
+  // SetThreadAffinityMask().
 
 #if KMP_GROUP_AFFINITY
   KMP_AFFINITY_ENABLE(__kmp_num_proc_groups * sizeof(DWORD_PTR));
@@ -950,8 +953,7 @@
   return 1e9 * __kmp_win32_tick * now.QuadPart;
 }
 
-extern "C"
-void *__stdcall __kmp_launch_worker(void *arg) {
+extern "C" void *__stdcall __kmp_launch_worker(void *arg) {
   volatile void *stack_data;
   void *exit_val;
   void *padding = 0;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95485.319494.patch
Type: text/x-patch
Size: 2341 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210127/2610d5ba/attachment-0001.bin>


More information about the Openmp-commits mailing list