tools include compiler-gcc: Add __pure attribute helper
authorArnaldo Carvalho de Melo <[email protected]>
Thu, 17 May 2018 18:12:36 +0000 (15:12 -0300)
committerArnaldo Carvalho de Melo <[email protected]>
Thu, 17 May 2018 18:17:21 +0000 (15:17 -0300)
Adopt it from the kernel sources, will be used soon.

Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Wang Nan <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/include/linux/compiler-gcc.h

index a3a4427441bfe97fac07605fdd2c9fe0bcc8c213..70fe612957338c84ffeb61f03c358c6ca1e32789 100644 (file)
@@ -21,6 +21,9 @@
 /* &a[0] degrades to a pointer: a different type from an array */
 #define __must_be_array(a)     BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
 
+#ifndef __pure
+#define  __pure                __attribute__((pure))
+#endif
 #define  noinline      __attribute__((noinline))
 #ifndef __packed
 #define __packed       __attribute__((packed))