Switch field destruction over to use the new destroyer-based API
and kill a lot of redundant code. llvm-svn: 134988
This commit is contained in:
@@ -627,18 +627,21 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const BlockExpr *blockExpr) {
|
||||
// Push a destructor if necessary. The semantics for when this
|
||||
// actually gets run are really obscure.
|
||||
if (!ci->isByRef()) {
|
||||
switch (type.isDestructedType()) {
|
||||
switch (QualType::DestructionKind dtorKind = type.isDestructedType()) {
|
||||
case QualType::DK_none:
|
||||
break;
|
||||
case QualType::DK_cxx_destructor:
|
||||
PushDestructorCleanup(type, blockField);
|
||||
break;
|
||||
|
||||
// Block captures count as local values and have imprecise semantics.
|
||||
// They also can't be arrays, so need to worry about that.
|
||||
case QualType::DK_objc_strong_lifetime:
|
||||
PushARCReleaseCleanup(getARCCleanupKind(), type, blockField, false);
|
||||
pushDestroy(getCleanupKind(dtorKind), blockField, type,
|
||||
destroyARCStrongImprecise,
|
||||
/*useEHCleanupForArray*/ false);
|
||||
break;
|
||||
|
||||
case QualType::DK_objc_weak_lifetime:
|
||||
// __weak objects on the stack always get EH cleanups.
|
||||
PushARCWeakReleaseCleanup(NormalAndEHCleanup, type, blockField);
|
||||
case QualType::DK_cxx_destructor:
|
||||
pushDestroy(dtorKind, blockField, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user