diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-15 19:54:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-15 19:54:31 +0000 |
commit | 6f0c67d4ffbc9c47153cab94985a22699b699729 (patch) | |
tree | d4675e182f50752cd9aa386ba9334ed69f781554 /include/llvm/Support/Compiler.h | |
parent | 9806f833a6697b835f1c795a1bd2f26a84d49d3c (diff) | |
download | llvm-6f0c67d4ffbc9c47153cab94985a22699b699729.tar.gz llvm-6f0c67d4ffbc9c47153cab94985a22699b699729.tar.bz2 llvm-6f0c67d4ffbc9c47153cab94985a22699b699729.tar.xz |
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.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index 0defe698b6..da31f98628 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 |