Fix an oversight: don't run ARC optimization cleanup at -O0.

llvm-svn: 154052
This commit is contained in:
Dan Gohman 2012-04-04 21:04:56 +00:00
parent d7290700e6
commit 1170b0885f
1 changed files with 2 additions and 1 deletions

View File

@ -382,7 +382,8 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
// Add ObjC ARC final-cleanup optimizations. This is done as part of the
// "codegen" passes so that it isn't run multiple times when there is
// inlining happening.
if (LangOpts.ObjCAutoRefCount)
if (LangOpts.ObjCAutoRefCount &&
CodeGenOpts.OptimizationLevel > 0)
PM->add(createObjCARCContractPass());
if (TM->addPassesToEmitFile(*PM, OS, CGFT,