Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/CodeGen/CGDecl.cpp
Show First 20 Lines • Show All 708 Lines • ▼ Show 20 Lines | case CK_LValueToRValue: { | ||||
// Handle a formal type change to avoid asserting. | // Handle a formal type change to avoid asserting. | ||||
auto srcAddr = srcLV.getAddress(CGF); | auto srcAddr = srcLV.getAddress(CGF); | ||||
if (needsCast) { | if (needsCast) { | ||||
srcAddr = CGF.Builder.CreateElementBitCast( | srcAddr = CGF.Builder.CreateElementBitCast( | ||||
srcAddr, destLV.getAddress(CGF).getElementType()); | srcAddr, destLV.getAddress(CGF).getElementType()); | ||||
} | } | ||||
// If it was an l-value, use objc_copyWeak. | // If it was an l-value, use objc_copyWeak. | ||||
if (srcExpr->getValueKind() == VK_LValue) { | if (srcExpr->isLValue()) { | ||||
CGF.EmitARCCopyWeak(destLV.getAddress(CGF), srcAddr); | CGF.EmitARCCopyWeak(destLV.getAddress(CGF), srcAddr); | ||||
} else { | } else { | ||||
assert(srcExpr->getValueKind() == VK_XValue); | assert(srcExpr->isXValue()); | ||||
CGF.EmitARCMoveWeak(destLV.getAddress(CGF), srcAddr); | CGF.EmitARCMoveWeak(destLV.getAddress(CGF), srcAddr); | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
// Stop at anything else. | // Stop at anything else. | ||||
default: | default: | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 1,948 Lines • Show Last 20 Lines |