diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2014-05-16 21:05:39 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2014-05-16 21:05:39 +0000 |
commit | 9c7228e582d5c245ee67aeb2cfc646a0f5a1eaf9 (patch) | |
tree | bd29b1ee523f00da1faea8df6662117073227d8c /lib/AST/Expr.cpp | |
parent | 074a8d3deaca2f135b98669c173bc3d97db670e4 (diff) | |
download | clang-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.cpp | 7 |
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!"); |