aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2012-04-04 21:04:56 +0000
committerDan Gohman <gohman@apple.com>2012-04-04 21:04:56 +0000
commit465a8998bd5e2565ed98e1179876ef9266581f74 (patch)
tree70362625debd7cdaee7b5aadf3e51cedf4353bce /lib/CodeGen/BackendUtil.cpp
parentf80f2a5098218211704bc4e66a8c2f46a8fa1d25 (diff)
Fix an oversight: don't run ARC optimization cleanup at -O0.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BackendUtil.cpp')
-rw-r--r--lib/CodeGen/BackendUtil.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index a65ae82c1d..edc3a47186 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -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,