summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTOCodeGenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/LTO/LTOCodeGenerator.cpp')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 3be805672d6..e0fcdec8ad0 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -488,6 +488,9 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
// Add an appropriate DataLayout instance for this module...
mergedModule->setDataLayout(TargetMach->getDataLayout());
+ passes.add(new DataLayoutPass());
+ TargetMach->addAnalysisPasses(passes);
+
Triple TargetTriple(TargetMach->getTargetTriple());
PassManagerBuilder PMB;
PMB.DisableGVNLoadPRE = DisableGVNLoadPRE;
@@ -501,7 +504,7 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
PMB.VerifyInput = true;
PMB.VerifyOutput = true;
- PMB.populateLTOPassManager(passes, TargetMach);
+ PMB.populateLTOPassManager(passes);
PassManager codeGenPasses;
OpenPOWER on IntegriCloud