[Openmp-commits] [PATCH] D12403: Fix GCC warning 'always_inline function might not be inlinable'

Andrey Churbanov via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 28 08:17:45 PDT 2015


AndreyChurbanov added a subscriber: AndreyChurbanov.
AndreyChurbanov added a comment.

Jonas,

I talked to the authors of this code (Intel Tools team) and they suggested to fix the problem in a slightly different way. Could you please check if the following diff solves it? And if yes, I would prefer we follow their change, so that we are in sync with other places (repositories) with ittnotify sources.

Thanks, Andrey

Index: runtime/src/thirdparty/ittnotify/ittnotify.h
===================================================

- runtime/src/thirdparty/ittnotify/ittnotify.h	(revision 246303)

+++ runtime/src/thirdparty/ittnotify/ittnotify.h	(working copy)
@@ -179,10 +179,11 @@

  */

#ifdef __STRICT_ANSI__
 #define ITT_INLINE           static
+#define ITT_INLINE_ATTRIBUTE __attribute__((unused))
 #else  /* __STRICT_ANSI__ */
 #define ITT_INLINE           static inline
+#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
 #endif /* __STRICT_ANSI__ */
-#define ITT_INLINE_ATTRIBUTE __attribute__ ((always_inline, unused))
 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
 /** @endcond */

Index: runtime/src/thirdparty/ittnotify/ittnotify_config.h
==========================================================

- runtime/src/thirdparty/ittnotify/ittnotify_config.h	(revision 246303)

+++ runtime/src/thirdparty/ittnotify/ittnotify_config.h	(working copy)
@@ -113,10 +113,11 @@

  */

#ifdef __STRICT_ANSI__
 #define ITT_INLINE           static
+#define ITT_INLINE_ATTRIBUTE __attribute__((unused))
 #else  /* __STRICT_ANSI__ */
 #define ITT_INLINE           static inline
+#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
 #endif /* __STRICT_ANSI__ */
-#define ITT_INLINE_ATTRIBUTE __attribute__ ((always_inline, unused))
 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
 /** @endcond */

Index: runtime/src/thirdparty/ittnotify/legacy/ittnotify.h
==========================================================

- runtime/src/thirdparty/ittnotify/legacy/ittnotify.h	(revision 246303)

+++ runtime/src/thirdparty/ittnotify/legacy/ittnotify.h	(working copy)
@@ -118,10 +118,11 @@

  */

#ifdef __STRICT_ANSI__
 #define ITT_INLINE           static
+#define ITT_INLINE_ATTRIBUTE __attribute__((unused))
 #else  /* __STRICT_ANSI__ */
 #define ITT_INLINE           static inline
+#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
 #endif /* __STRICT_ANSI__ */
-#define ITT_INLINE_ATTRIBUTE __attribute__ ((always_inline, unused))
 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
 /** @endcond */


Repository:
  rL LLVM

http://reviews.llvm.org/D12403





More information about the Openmp-commits mailing list