mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 19:06:02 +03:00
Fix LLVM 3.6 build
This commit is contained in:
parent
a6b864d42c
commit
b73e5fb5ef
2 changed files with 15 additions and 2 deletions
|
@ -48,6 +48,9 @@
|
||||||
#include "llvm/Support/TargetRegistry.h"
|
#include "llvm/Support/TargetRegistry.h"
|
||||||
#include "llvm/Support/TargetSelect.h"
|
#include "llvm/Support/TargetSelect.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
|
#if LDC_LLVM_VER >= 306
|
||||||
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
||||||
|
#endif
|
||||||
#if LDC_LLVM_VER >= 303
|
#if LDC_LLVM_VER >= 303
|
||||||
#include "llvm/LinkAllIR.h"
|
#include "llvm/LinkAllIR.h"
|
||||||
#include "llvm/IR/LLVMContext.h"
|
#include "llvm/IR/LLVMContext.h"
|
||||||
|
@ -971,7 +974,9 @@ int main(int argc, char **argv)
|
||||||
global.params.is64bit = triple.isArch64Bit();
|
global.params.is64bit = triple.isArch64Bit();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LDC_LLVM_VER >= 302
|
#if LDC_LLVM_VER >= 306
|
||||||
|
gDataLayout = gTargetMachine->getSubtargetImpl()->getDataLayout();
|
||||||
|
#elif LDC_LLVM_VER >= 302
|
||||||
gDataLayout = gTargetMachine->getDataLayout();
|
gDataLayout = gTargetMachine->getDataLayout();
|
||||||
#else
|
#else
|
||||||
gDataLayout = gTargetMachine->getTargetData();
|
gDataLayout = gTargetMachine->getTargetData();
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
#include "llvm/Support/PathV1.h"
|
#include "llvm/Support/PathV1.h"
|
||||||
#endif
|
#endif
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
|
#if LDC_LLVM_VER >= 306
|
||||||
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
||||||
|
#endif
|
||||||
#if LDC_LLVM_VER >= 303
|
#if LDC_LLVM_VER >= 303
|
||||||
#include "llvm/IR/Module.h"
|
#include "llvm/IR/Module.h"
|
||||||
#else
|
#else
|
||||||
|
@ -61,7 +64,12 @@ static void codegenModule(llvm::TargetMachine &Target, llvm::Module& m,
|
||||||
// about to build.
|
// about to build.
|
||||||
PassManager Passes;
|
PassManager Passes;
|
||||||
|
|
||||||
#if LDC_LLVM_VER >= 305
|
#if LDC_LLVM_VER >= 306
|
||||||
|
if (const DataLayout *DL = Target.getSubtargetImpl()->getDataLayout())
|
||||||
|
Passes.add(new DataLayoutPass(*DL));
|
||||||
|
else
|
||||||
|
Passes.add(new DataLayoutPass(&m));
|
||||||
|
#elif LDC_LLVM_VER == 305
|
||||||
if (const DataLayout *DL = Target.getDataLayout())
|
if (const DataLayout *DL = Target.getDataLayout())
|
||||||
Passes.add(new DataLayoutPass(*DL));
|
Passes.add(new DataLayoutPass(*DL));
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue