summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-04-01 08:22:59 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-04-01 08:22:59 +0000
commit215d59e7b0b14968c2f0c33c6575373455a84359 (patch)
tree625f1ae23742be3b2ae346ad35138644dd8b00e6 /llvm/lib
parent7d15853c9f4b26fe87b70dc89101eb34d0e9e221 (diff)
downloadbcm5719-llvm-215d59e7b0b14968c2f0c33c6575373455a84359.tar.gz
bcm5719-llvm-215d59e7b0b14968c2f0c33c6575373455a84359.zip
ThinLTO: move ObjCARCContractPass in the CodeGen pipeline
This is to be coherent with Full LTO. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265118
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/LTO/ThinLTOCodeGenerator.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
index 412475d1c98..b8679767e20 100644
--- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -160,7 +160,6 @@ static void optimizeModule(Module &TheModule, TargetMachine &TM) {
// Add optimizations
PMB.populateThinLTOPassManager(PM);
- PM.add(createObjCARCContractPass());
PM.run(TheModule);
}
@@ -173,6 +172,12 @@ std::unique_ptr<MemoryBuffer> codegenModule(Module &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");
OpenPOWER on IntegriCloud