[Openmp-commits] [openmp] fedbff7 - [OpenMP][OMPT] Fix compile-time assertion in ompt-multiplex.h

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 12 03:13:01 PDT 2021


Author: Joachim Protze
Date: 2021-07-12T12:12:09+02:00
New Revision: fedbff75f46b4b9e055ab4947960fa95a08a78ed

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

LOG: [OpenMP][OMPT] Fix compile-time assertion in ompt-multiplex.h

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

Reported by: Semih Burak

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/openmp/tools/multiplex/ompt-multiplex.h b/openmp/tools/multiplex/ompt-multiplex.h
index bd907f9caa8eb..041b15233c6b0 100644
--- a/openmp/tools/multiplex/ompt-multiplex.h
+++ b/openmp/tools/multiplex/ompt-multiplex.h
@@ -38,8 +38,19 @@ static ompt_get_parallel_info_t ompt_multiplex_get_parallel_info;
 #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


        


More information about the Openmp-commits mailing list