Skip to content

Commit 1170b08

Browse files
author
Dan Gohman
committed
Fix an oversight: don't run ARC optimization cleanup at -O0.
llvm-svn: 154052
1 parent d729070 commit 1170b08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
382382
// Add ObjC ARC final-cleanup optimizations. This is done as part of the
383383
// "codegen" passes so that it isn't run multiple times when there is
384384
// inlining happening.
385-
if (LangOpts.ObjCAutoRefCount)
385+
if (LangOpts.ObjCAutoRefCount &&
386+
CodeGenOpts.OptimizationLevel > 0)
386387
PM->add(createObjCARCContractPass());
387388

388389
if (TM->addPassesToEmitFile(*PM, OS, CGFT,

0 commit comments

Comments
 (0)