[cfe-commits] r148331 - /cfe/trunk/lib/CodeGen/BackendUtil.cpp

Dan Gohman gohman at apple.com
Tue Jan 17 12:54:51 PST 2012


Author: djg
Date: Tue Jan 17 14:54:51 2012
New Revision: 148331

URL: http://llvm.org/viewvc/llvm-project?rev=148331&view=rev
Log:
Enable the new ObjC ARC autorelease pool elimination pass.

Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=148331&r1=148330&r2=148331&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Tue Jan 17 14:54:51 2012
@@ -106,6 +106,11 @@
 
 }
 
+static void addObjCARCAPElimPass(const PassManagerBuilder &Builder, PassManagerBase &PM) {
+  if (Builder.OptLevel > 0)
+    PM.add(createObjCARCAPElimPass());
+}
+
 static void addObjCARCExpandPass(const PassManagerBuilder &Builder, PassManagerBase &PM) {
   if (Builder.OptLevel > 0)
     PM.add(createObjCARCExpandPass());
@@ -144,6 +149,8 @@
   if (LangOpts.ObjCAutoRefCount) {
     PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
                            addObjCARCExpandPass);
+    PMBuilder.addExtension(PassManagerBuilder::EP_ModuleOptimizerEarly,
+                           addObjCARCAPElimPass);
     PMBuilder.addExtension(PassManagerBuilder::EP_ScalarOptimizerLate,
                            addObjCARCOptPass);
   }





More information about the cfe-commits mailing list