summaryrefslogtreecommitdiffstats
path: root/include/clang/Sema/AttributeList.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-03-18 22:38:29 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-03-18 22:38:29 +0000
commit207f4d8543529221932af82836016a2ef066c917 (patch)
treeeae7fb3e3d3510d05ea94fdbea4c868d19f49dc6 /include/clang/Sema/AttributeList.h
parent1761ce57d612be423f5ac323a2051fdcb46cefc5 (diff)
Add support for language-specific address spaces. On top of that,
add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/AttributeList.h')
-rw-r--r--include/clang/Sema/AttributeList.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Sema/AttributeList.h b/include/clang/Sema/AttributeList.h
index 10b859e9f9..382e50494e 100644
--- a/include/clang/Sema/AttributeList.h
+++ b/include/clang/Sema/AttributeList.h
@@ -18,6 +18,7 @@
#include "llvm/Support/Allocator.h"
#include "clang/Sema/Ownership.h"
#include "clang/Basic/SourceLocation.h"
+#include "clang/AST/Expr.h"
#include <cassert>
namespace clang {
@@ -76,6 +77,13 @@ public:
declspec, cxx0x);
return Mem;
}
+
+ AttributeList* CreateIntegerAttribute(ASTContext &C, IdentifierInfo *Name,
+ SourceLocation TokLoc, int Arg) {
+ Expr* IArg = IntegerLiteral::Create(C, llvm::APInt(32, (uint64_t)Arg),
+ C.IntTy, TokLoc);
+ return Create( Name, TokLoc, 0, TokLoc, 0, TokLoc, &IArg, 1, 0);
+ }
};
enum Kind { // Please keep this list alphabetized.
@@ -135,6 +143,7 @@ public:
AT_ns_consumed, // Clang-specific.
AT_ns_consumes_self, // Clang-specific.
AT_objc_gc,
+ AT_opencl_image_access, // OpenCL-specific.
AT_opencl_kernel_function, // OpenCL-specific.
AT_overloadable, // Clang-specific.
AT_ownership_holds, // Clang-specific.