summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2012-05-20 21:08:35 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2012-05-20 21:08:35 +0000
commitf44bdf9c5fc347f1639d50c49de2b836f28017e2 (patch)
treea21092fbd172f3ac505a42a8bc578d9daeee9b77 /clang/lib/AST
parent853a8a982bb9b3220e3625b725b15faa8ba91d99 (diff)
downloadbcm5719-llvm-f44bdf9c5fc347f1639d50c49de2b836f28017e2.tar.gz
bcm5719-llvm-f44bdf9c5fc347f1639d50c49de2b836f28017e2.zip
CUDA: add CodeGen support for global variable address spaces.
Because in CUDA types do not have associated address spaces, globals are declared in their "native" address space, and accessed by bitcasting the pointer to address space 0. This relies on address space 0 being a unified address space. llvm-svn: 157167
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTContext.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index a5028338cb6..27057883e5f 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -206,7 +206,10 @@ static const LangAS::Map *getAddressSpaceMap(const TargetInfo &T,
static const unsigned FakeAddrSpaceMap[] = {
1, // opencl_global
2, // opencl_local
- 3 // opencl_constant
+ 3, // opencl_constant
+ 4, // cuda_device
+ 5, // cuda_constant
+ 6 // cuda_shared
};
return &FakeAddrSpaceMap;
} else {
OpenPOWER on IntegriCloud