]> granicus.if.org Git - clang/commitdiff
Fix -fobjc-arc doesn't work with -save-temps
authorSteven Wu <stevenwu@apple.com>
Sat, 2 May 2015 00:56:15 +0000 (00:56 +0000)
committerSteven Wu <stevenwu@apple.com>
Sat, 2 May 2015 00:56:15 +0000 (00:56 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236372 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BackendUtil.cpp

index 22ae565b38f2a130b355408900cc784228b9cf01..c8894553bcb9ffd48f75b9f0987417e0f940c60f 100644 (file)
@@ -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,