[llvm-commits] [llvm] r88862 - /llvm/trunk/include/llvm/Support/Compiler.h
Chris Lattner
sabre at nondot.org
Sun Nov 15 11:54:31 PST 2009
Author: lattner
Date: Sun Nov 15 13:54:31 2009
New Revision: 88862
URL: http://llvm.org/viewvc/llvm-project?rev=88862&view=rev
Log:
add attributes for readnone/readonly functions.
Modified:
llvm/trunk/include/llvm/Support/Compiler.h
Modified: llvm/trunk/include/llvm/Support/Compiler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=88862&r1=88861&r2=88862&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Compiler.h (original)
+++ llvm/trunk/include/llvm/Support/Compiler.h Sun Nov 15 13:54:31 2009
@@ -29,6 +29,18 @@
#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
More information about the llvm-commits
mailing list