summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAndrew Savonichev <andrew.savonichev@intel.com>2018-12-12 09:51:23 +0000
committerAndrew Savonichev <andrew.savonichev@intel.com>2018-12-12 09:51:23 +0000
commit87a7e436c0b9b248aa99741815b23c58a648e1a6 (patch)
tree41c2b17dec7f60909eab8bc2b7aef762f766469d /clang/lib
parent4b94a3064a8499b1cbcd04492c48969c4861f031 (diff)
downloadbcm5719-llvm-87a7e436c0b9b248aa99741815b23c58a648e1a6.tar.gz
bcm5719-llvm-87a7e436c0b9b248aa99741815b23c58a648e1a6.zip
[OpenCL] Fix for TBAA information of pointer after addresspacecast
Summary: When addresspacecast is generated resulting pointer should preserve TBAA information from original value. Reviewers: rjmccall, yaxunl, Anastasia Reviewed By: rjmccall Subscribers: asavonic, kosarev, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D55262 llvm-svn: 348919
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 3c5eea49d1a..b6f26a683e4 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -4269,8 +4269,9 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) {
QualType DestTy = getContext().getPointerType(E->getType());
llvm::Value *V = getTargetHooks().performAddrSpaceCast(
*this, LV.getPointer(), E->getSubExpr()->getType().getAddressSpace(),
- DestTy.getAddressSpace(), ConvertType(DestTy));
- return MakeNaturalAlignPointeeAddrLValue(V, DestTy);
+ E->getType().getAddressSpace(), ConvertType(DestTy));
+ return MakeAddrLValue(Address(V, LV.getAddress().getAlignment()),
+ E->getType(), LV.getBaseInfo(), LV.getTBAAInfo());
}
case CK_ObjCObjectLValueCast: {
LValue LV = EmitLValue(E->getSubExpr());
OpenPOWER on IntegriCloud