From: Mike Stump Date: Thu, 5 Mar 2009 02:34:38 +0000 (+0000) Subject: Avoid dispose calls when only doing gc. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9e0fae40a902ddbd4d53ef60ba7fb908788fe60;p=clang Avoid dispose calls when only doing gc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66126 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index a01aad66b0..f31a05a9a6 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -391,7 +391,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { EmitCall(CGM.getTypes().getFunctionInfo(FD), F, Args); } - if (needsDispose) { + if (needsDispose && CGM.getLangOptions().getGCMode() != LangOptions::GCOnly) { CleanupScope scope(*this); BuildBlockRelease(D, DeclPtr); }