[llvm] r265118 - ThinLTO: move ObjCARCContractPass in the CodeGen pipeline

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 01:23:00 PDT 2016


Author: mehdi_amini
Date: Fri Apr  1 03:22:59 2016
New Revision: 265118

URL: http://llvm.org/viewvc/llvm-project?rev=265118&view=rev
Log:
ThinLTO: move ObjCARCContractPass in the CodeGen pipeline

This is to be coherent with Full LTO.

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp

Modified: llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp?rev=265118&r1=265117&r2=265118&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp (original)
+++ llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp Fri Apr  1 03:22:59 2016
@@ -160,7 +160,6 @@ static void optimizeModule(Module &TheMo
 
   // Add optimizations
   PMB.populateThinLTOPassManager(PM);
-  PM.add(createObjCARCContractPass());
 
   PM.run(TheModule);
 }
@@ -173,6 +172,12 @@ std::unique_ptr<MemoryBuffer> codegenMod
   {
     raw_svector_ostream OS(OutputBuffer);
     legacy::PassManager PM;
+
+    // If the bitcode files contain ARC code and were compiled with optimization,
+    // the ObjCARCContractPass must be run, so do it unconditionally here.
+    PM.add(createObjCARCContractPass());
+
+    // Setup the codegen now.
     if (TM.addPassesToEmitFile(PM, OS, TargetMachine::CGFT_ObjectFile,
                                /* DisableVerify */ true))
       report_fatal_error("Failed to setup codegen");




More information about the llvm-commits mailing list