summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorAnastasia Stulova <anastasia.stulova@arm.com>2019-04-04 10:48:36 +0000
committerAnastasia Stulova <anastasia.stulova@arm.com>2019-04-04 10:48:36 +0000
commit094c72660a30c06085b86b7115165f6cc687f662 (patch)
tree30b3d65517e10246cd87400a1e4f9a733b3a7d17 /clang/lib/CodeGen/CGExprAgg.cpp
parent153c3887e4e7181f872309312a46965dbaea750f (diff)
downloadbcm5719-llvm-094c72660a30c06085b86b7115165f6cc687f662.tar.gz
bcm5719-llvm-094c72660a30c06085b86b7115165f6cc687f662.zip
[PR41276] Fixed incorrect generation of addr space cast for 'this' in C++.
Improved classification of address space cast when qualification conversion is performed - prevent adding addr space cast for non-pointer and non-reference types. Take address space correctly from the pointee. Also pass correct address space from 'this' object using AggValueSlot when generating addrspacecast in the constructor call. Differential Revision: https://reviews.llvm.org/D59988 llvm-svn: 357682
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 161d6ed34eb..cd49be4bd4a 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -783,6 +783,8 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
RValue rvalue = RValue::getAggregate(valueAddr, atomicSlot.isVolatile());
return EmitFinalDestCopy(valueType, rvalue);
}
+ case CK_AddressSpaceConversion:
+ return Visit(E->getSubExpr());
case CK_LValueToRValue:
// If we're loading from a volatile type, force the destination
@@ -794,6 +796,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
LLVM_FALLTHROUGH;
+
case CK_NoOp:
case CK_UserDefinedConversion:
case CK_ConstructorConversion:
@@ -849,7 +852,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
case CK_CopyAndAutoreleaseBlockObject:
case CK_BuiltinFnToFnPtr:
case CK_ZeroToOCLOpaqueType:
- case CK_AddressSpaceConversion:
+
case CK_IntToOCLSampler:
case CK_FixedPointCast:
case CK_FixedPointToBoolean:
OpenPOWER on IntegriCloud