mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-29 22:50:53 +03:00
Fix latest LLVM 3.6 changes
This commit is contained in:
parent
5a89bf68a7
commit
bef163f559
2 changed files with 8 additions and 6 deletions
|
@ -327,7 +327,9 @@ bool ldc_optimize_module(llvm::Module *M)
|
|||
mpm.add(tli);
|
||||
|
||||
// Add an appropriate DataLayout instance for this module.
|
||||
#if LDC_LLVM_VER >= 305
|
||||
#if LDC_LLVM_VER >= 306
|
||||
mpm.add(new DataLayoutPass());
|
||||
#elif LDC_LLVM_VER == 305
|
||||
const DataLayout *DL = M->getDataLayout();
|
||||
assert(DL && "DataLayout not set at module");
|
||||
mpm.add(new DataLayoutPass(*DL));
|
||||
|
@ -344,7 +346,10 @@ bool ldc_optimize_module(llvm::Module *M)
|
|||
|
||||
// Also set up a manager for the per-function passes.
|
||||
FunctionPassManager fpm(M);
|
||||
#if LDC_LLVM_VER >= 305
|
||||
#if LDC_LLVM_VER >= 306
|
||||
fpm.add(new DataLayoutPass());
|
||||
gTargetMachine->addAnalysisPasses(fpm);
|
||||
#elif LDC_LLVM_VER == 305
|
||||
fpm.add(new DataLayoutPass(M));
|
||||
gTargetMachine->addAnalysisPasses(fpm);
|
||||
#elif LDC_LLVM_VER >= 302
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue