[Openmp-commits] [PATCH] D103607: [OpenMP][Tools] Fix Archer for MACOS

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Jun 6 08:31:01 PDT 2021


Hahnfeld added inline comments.


================
Comment at: openmp/tools/archer/ompt-tsan.cpp:164
   fptr = (int (*)())dlsym(RTLD_DEFAULT, "RunningOnValgrind");
-  if (fptr && fptr != RunningOnValgrind)
+  if (!fptr || fptr == RunningOnValgrind)
     runOnTsan = 0;
----------------
Can you explain this change? Why do we disable TSan if `dlsym` finds the current function? (`RunningOnValgrind` resolves to the current function, right?)


================
Comment at: openmp/tools/archer/ompt-tsan.cpp:1020
+  if (NULL == (f = fSig dlsym(RTLD_DEFAULT, #f)))                              \
+  printf("Unable to find TSan function " #f ".\n")
+
----------------
Can you indent this line? It's the body of the `if`.

As a general comment, maybe wrap the entire macro in `do { ... } while (0)` so the semicolon doesn't terminate the `if` body?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103607



More information about the Openmp-commits mailing list