summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2015-05-02 00:56:15 +0000
committerSteven Wu <stevenwu@apple.com>2015-05-02 00:56:15 +0000
commit1d56be869e76a0408f13759f32a898e7fddc5146 (patch)
tree6308e1f5d911958ee6c86d338f0a1e589b6dba26 /clang/lib/CodeGen/BackendUtil.cpp
parent40055d118548c00f144ef73f947d764e9b6057bc (diff)
downloadbcm5719-llvm-1d56be869e76a0408f13759f32a898e7fddc5146.tar.gz
bcm5719-llvm-1d56be869e76a0408f13759f32a898e7fddc5146.zip
Fix -fobjc-arc doesn't work with -save-temps
The underlying problem is that there is currently no way to run ObjCARCContract from llvm bitcode which is required by ObjC ARC. This fix the problem by always enable ObjCARCContract pass if optimization is enabled. The ObjCARC Contract pass has almost no overhead on code that is not using ARC. llvm-svn: 236372
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 22ae565b38f..c8894553bcb 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -571,8 +571,7 @@ 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 &&
- CodeGenOpts.OptimizationLevel > 0)
+ if (CodeGenOpts.OptimizationLevel > 0)
PM->add(createObjCARCContractPass());
if (TM->addPassesToEmitFile(*PM, OS, CGFT,
OpenPOWER on IntegriCloud