// Add optimizations
PMB.populateThinLTOPassManager(PM);
- PM.add(createObjCARCContractPass());
PM.run(TheModule);
}
{
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");