summaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-05-16 21:05:39 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-05-16 21:05:39 +0000
commit9c7228e582d5c245ee67aeb2cfc646a0f5a1eaf9 (patch)
treebd29b1ee523f00da1faea8df6662117073227d8c /lib/AST/Expr.cpp
parent074a8d3deaca2f135b98669c173bc3d97db670e4 (diff)
downloadclang-9c7228e582d5c245ee67aeb2cfc646a0f5a1eaf9.tar.gz
clang-9c7228e582d5c245ee67aeb2cfc646a0f5a1eaf9.tar.bz2
clang-9c7228e582d5c245ee67aeb2cfc646a0f5a1eaf9.tar.xz
Merging r197036:
------------------------------------------------------------------------ r197036 | david.tweed | 2013-12-11 08:39:46 -0500 (Wed, 11 Dec 2013) | 8 lines Add front-end infrastructure now address space casts are in LLVM IR. With the introduction of explicit address space casts into LLVM, there's a need to provide a new cast kind the front-end can create for C/OpenCL/CUDA and code to produce address space casts from those kinds when appropriate. Patch by Michele Scandale! ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@209029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r--lib/AST/Expr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 9055ddac35..6307f4c0db 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -1474,6 +1474,11 @@ void CastExpr::CheckCastConsistency() const {
assert(getSubExpr()->getType()->isFunctionType());
goto CheckNoBasePath;
+ case CK_AddressSpaceConversion:
+ assert(getType()->isPointerType());
+ assert(getSubExpr()->getType()->isPointerType());
+ assert(getType()->getPointeeType().getAddressSpace() !=
+ getSubExpr()->getType()->getPointeeType().getAddressSpace());
// These should not have an inheritance path.
case CK_Dynamic:
case CK_ToUnion:
@@ -1636,6 +1641,8 @@ const char *CastExpr::getCastKindName() const {
return "BuiltinFnToFnPtr";
case CK_ZeroToOCLEvent:
return "ZeroToOCLEvent";
+ case CK_AddressSpaceConversion:
+ return "AddressSpaceConversion";
}
llvm_unreachable("Unhandled cast kind!");