Do not apply the ARC move optimization to 'const'-qualified xvalues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133861 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 2782c2b..4c59e6a 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -2269,7 +2269,7 @@
// If we're loading retained from a __strong xvalue, we can avoid
// an extra retain/release pair by zeroing out the source of this
// "move" operation.
- if (e->isXValue() &&
+ if (e->isXValue() && !e->getType().isConstQualified() &&
e->getType().getObjCLifetime() == Qualifiers::OCL_Strong) {
// Emit the lvalue
LValue lv = CGF.EmitLValue(e);