Merge pull request #860 from Vsevolod-Livinskij/fix_217548
LLVM trunk: DataLayoutPass has new constructor.
This commit is contained in:
10
module.cpp
10
module.cpp
@@ -1107,10 +1107,14 @@ Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine,
|
|||||||
}
|
}
|
||||||
|
|
||||||
llvm::PassManager pm;
|
llvm::PassManager pm;
|
||||||
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) // LLVM 3.5+
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4)
|
||||||
pm.add(new llvm::DataLayoutPass(*g->target->getDataLayout()));
|
|
||||||
#else
|
|
||||||
pm.add(new llvm::DataLayout(*g->target->getDataLayout()));
|
pm.add(new llvm::DataLayout(*g->target->getDataLayout()));
|
||||||
|
#elif defined(LLVM_3_5)
|
||||||
|
pm.add(new llvm::DataLayoutPass(*g->target->getDataLayout()));
|
||||||
|
#else // LLVM 3.6+
|
||||||
|
llvm::DataLayoutPass *dlp= new llvm::DataLayoutPass();
|
||||||
|
dlp->doInitialization(*module);
|
||||||
|
pm.add(dlp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
llvm::formatted_raw_ostream fos(of->os());
|
llvm::formatted_raw_ostream fos(of->os());
|
||||||
|
|||||||
10
opt.cpp
10
opt.cpp
@@ -470,10 +470,14 @@ Optimize(llvm::Module *module, int optLevel) {
|
|||||||
new llvm::TargetLibraryInfo(llvm::Triple(module->getTargetTriple()));
|
new llvm::TargetLibraryInfo(llvm::Triple(module->getTargetTriple()));
|
||||||
optPM.add(targetLibraryInfo);
|
optPM.add(targetLibraryInfo);
|
||||||
|
|
||||||
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) // LLVM 3.5+
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4)
|
||||||
optPM.add(new llvm::DataLayoutPass(*g->target->getDataLayout()));
|
|
||||||
#else
|
|
||||||
optPM.add(new llvm::DataLayout(*g->target->getDataLayout()));
|
optPM.add(new llvm::DataLayout(*g->target->getDataLayout()));
|
||||||
|
#elif defined(LLVM_3_5)
|
||||||
|
optPM.add(new llvm::DataLayoutPass(*g->target->getDataLayout()));
|
||||||
|
#else // LLVM 3.6+
|
||||||
|
llvm::DataLayoutPass *dlp= new llvm::DataLayoutPass();
|
||||||
|
dlp->doInitialization(*module);
|
||||||
|
optPM.add(dlp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
llvm::TargetMachine *targetMachine = g->target->GetTargetMachine();
|
llvm::TargetMachine *targetMachine = g->target->GetTargetMachine();
|
||||||
|
|||||||
Reference in New Issue
Block a user