add attributes for readnone/readonly functions.

llvm-svn: 88862
This commit is contained in:
Chris Lattner 2009-11-15 19:54:31 +00:00
parent 8938c85eb5
commit f456ae74c8
1 changed files with 12 additions and 0 deletions

View File

@ -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