diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp')
| -rw-r--r-- | contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp index 791a57e61f53..2b2a92dd6019 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp +++ b/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp @@ -623,9 +623,13 @@ static void enterBlockScope(CodeGenFunction &CGF, BlockDecl *block) {      // For const-qualified captures, emit clang.arc.use to ensure the captured      // object doesn't get released while we are still depending on its validity      // within the block. -    if (VT.isConstQualified() && VT.getObjCLifetime() == Qualifiers::OCL_Strong) +    if (VT.isConstQualified() && +        VT.getObjCLifetime() == Qualifiers::OCL_Strong && +        CGF.CGM.getCodeGenOpts().OptimizationLevel != 0) { +      assert(CGF.CGM.getLangOpts().ObjCAutoRefCount && +             "expected ObjC ARC to be enabled");        destroyer = CodeGenFunction::emitARCIntrinsicUse; -    else if (dtorKind == QualType::DK_objc_strong_lifetime) { +    } else if (dtorKind == QualType::DK_objc_strong_lifetime) {        destroyer = CodeGenFunction::destroyARCStrongImprecise;      } else {        destroyer = CGF.getDestroyer(dtorKind);  | 
