[Openmp-commits] [PATCH] D155316: [OMPT] Fix use of 'DEBUG_PREFIX' in the OMPT headers

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jul 14 10:38:08 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, JonChesterfield, tianshilei1992, mhalk, dhruvachak.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

This is the only place that defines  this prefix in a header file and
was thus overriding and redefining other users of it. If we must use it
in a header file, at least repsect its old values.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155316

Files:
  openmp/libomptarget/include/OmptCallback.h
  openmp/libomptarget/include/OmptConnector.h


Index: openmp/libomptarget/include/OmptConnector.h
===================================================================
--- openmp/libomptarget/include/OmptConnector.h
+++ openmp/libomptarget/include/OmptConnector.h
@@ -27,8 +27,9 @@
 #include "Debug.h"
 #include "omptarget.h"
 
+#pragma push_macro("DEBUG_PREFIX")
+#undef DEBUG_PREFIX
 #define DEBUG_PREFIX "OMPT"
-#define LIBOMPTARGET_STRINGIFY(s) #s
 
 /// Type for the function to be invoked for connecting two libraries.
 typedef void (*OmptConnectRtnTy)(ompt_start_tool_result_t *result);
@@ -103,4 +104,6 @@
 
 #endif // OMPT_SUPPORT
 
+#pragma pop_macro("DEBUG_PREFIX")
+
 #endif // _OMPTCONNECTOR_H
Index: openmp/libomptarget/include/OmptCallback.h
===================================================================
--- openmp/libomptarget/include/OmptCallback.h
+++ openmp/libomptarget/include/OmptCallback.h
@@ -18,6 +18,8 @@
 
 #include "omp-tools.h"
 
+#pragma push_macro("DEBUG_PREFIX")
+#undef DEBUG_PREFIX
 #define DEBUG_PREFIX "OMPT"
 
 #define FOREACH_OMPT_TARGET_CALLBACK(macro)                                    \
@@ -82,4 +84,6 @@
 
 #endif // OMPT_SUPPORT
 
+#pragma pop_macro("DEBUG_PREFIX")
+
 #endif // _OMPTCALLBACK_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155316.540489.patch
Type: text/x-patch
Size: 1196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230714/2b77edf8/attachment.bin>


More information about the Openmp-commits mailing list