aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/Compiler.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-15 19:54:31 +0000
committerChris Lattner <sabre@nondot.org>2009-11-15 19:54:31 +0000
commita50e9237b7d8cdeace748653d7f96b9899fe22b7 (patch)
treed4675e182f50752cd9aa386ba9334ed69f781554 /include/llvm/Support/Compiler.h
parent3ecb882db35446d5ee649d4d75b5e2de542c8c40 (diff)
downloadexternal_llvm-a50e9237b7d8cdeace748653d7f96b9899fe22b7.zip
external_llvm-a50e9237b7d8cdeace748653d7f96b9899fe22b7.tar.gz
external_llvm-a50e9237b7d8cdeace748653d7f96b9899fe22b7.tar.bz2
add attributes for readnone/readonly functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Compiler.h')
-rw-r--r--include/llvm/Support/Compiler.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index 0defe69..da31f98 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -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