summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorPekka Jaaskelainen <pekka.jaaskelainen@tut.fi>2014-12-19 18:04:27 +0000
committerPekka Jaaskelainen <pekka.jaaskelainen@tut.fi>2014-12-19 18:04:27 +0000
commite94b0e187005ddbc3e5e8018829fada07379a542 (patch)
treec17430d467b933e3eb80184ea07aca1300d2736f /clang/lib
parentcd8500e500d9359575a1b762d8dfc7d608e20d47 (diff)
downloadbcm5719-llvm-e94b0e187005ddbc3e5e8018829fada07379a542.tar.gz
bcm5719-llvm-e94b0e187005ddbc3e5e8018829fada07379a542.zip
Fix an address space id reset with array decay's
implicit conversion. The issue was produced with OpenCL C code that called a function with a constant string literal argument. llvm-svn: 224592
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index a4430dffb05..0fef4462eb9 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -1412,7 +1412,8 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
if (!E->getType()->isVariableArrayType()) {
assert(isa<llvm::PointerType>(V->getType()) && "Expected pointer");
V = CGF.Builder.CreatePointerCast(
- V, ConvertType(E->getType())->getPointerTo());
+ V, ConvertType(E->getType())->getPointerTo(
+ V->getType()->getPointerAddressSpace()));
assert(isa<llvm::ArrayType>(V->getType()->getPointerElementType()) &&
"Expected pointer to array");
OpenPOWER on IntegriCloud