add attributes for readnone/readonly functions.
authorChris Lattner <sabre@nondot.org>
Sun, 15 Nov 2009 19:54:31 +0000 (19:54 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 15 Nov 2009 19:54:31 +0000 (19:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88862 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Compiler.h

index 0defe698b6ce3502d901f872d0c93e1187983f46..da31f9862885fea54420e484bd4e0350ecd05d64 100644 (file)
 #define ATTRIBUTE_USED
 #endif
 
+#ifdef __GNUC__ // aka 'ATTRIBUTE_CONST' but following LLVM Conventions.
+#define ATTRIBUTE_READNONE __attribute__((__const__))
+#else
+#define ATTRIBUTE_READNONE
+#endif
+
+#ifdef __GNUC__  // aka 'ATTRIBUTE_PURE' but following LLVM Conventions.
+#define ATTRIBUTE_READONLY __attribute__((__pure__))
+#else
+#define ATTRIBUTE_READONLY
+#endif
+
 #if (__GNUC__ >= 4)
 #define BUILTIN_EXPECT(EXPR, VALUE) __builtin_expect((EXPR), (VALUE))
 #else