[Openmp-commits] [PATCH] D104633: [OpenMP][OMPT] Fix compile-time assertion in multiplex.h

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jun 21 03:53:40 PDT 2021


protze.joachim created this revision.
protze.joachim added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
protze.joachim requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

The compile-time assertion is supposed to prevent double-free caused by unexpected combination of preprocessor defines passed by an OMPT tool.
The current defines are not used, so this patch replaces the check with macros actually used in ompt-multiplex.h


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104633

Files:
  openmp/tools/multiplex/ompt-multiplex.h


Index: openmp/tools/multiplex/ompt-multiplex.h
===================================================================
--- openmp/tools/multiplex/ompt-multiplex.h
+++ openmp/tools/multiplex/ompt-multiplex.h
@@ -38,8 +38,19 @@
 #error CLIENT_TOOL_LIBRARIES_VAR should be defined before including of ompt-multiplex.h
 #endif
 
-#if defined(CUSTOM_DELETE_DATA) && !defined(CUSTOM_GET_CLIENT_DATA)
-#error CUSTOM_GET_CLIENT_DATA must be set if CUSTOM_DELETE_DATA is set
+#if defined(OMPT_MULTIPLEX_CUSTOM_DELETE_TASK_DATA) &&                         \
+    !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TASK_DATA)
+#error OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TASK_DATA must be set if OMPT_MULTIPLEX_CUSTOM_DELETE_TASK_DATA is set
+#endif
+
+#if defined(OMPT_MULTIPLEX_CUSTOM_DELETE_PARALLEL_DATA) &&                     \
+    !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_PARALLEL_DATA)
+#error OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_PARALLEL_DATA must be set if OMPT_MULTIPLEX_CUSTOM_DELETE_PARALLEL_DATA is set
+#endif
+
+#if defined(OMPT_MULTIPLEX_CUSTOM_DELETE_THREAD_DATA) &&                       \
+    !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_THREAD_DATA)
+#error OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_THREAD_DATA must be set if OMPT_MULTIPLEX_CUSTOM_DELETE_THREAD_DATA is set
 #endif
 
 #define OMPT_API_ROUTINE static


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104633.353327.patch
Type: text/x-patch
Size: 1299 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210621/3edf9f2d/attachment-0001.bin>


More information about the Openmp-commits mailing list