diff --git a/gb.jit/src/jit.h b/gb.jit/src/jit.h index fd141d9b6..9959ded2c 100644 --- a/gb.jit/src/jit.h +++ b/gb.jit/src/jit.h @@ -26,20 +26,32 @@ #ifndef __JIT_H #define __JIT_H +#include +#if (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 3) +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Intrinsics.h" +#include "llvm/IR/Instructions.h" +#else #include "llvm/LLVMContext.h" #include "llvm/Module.h" -#include "llvm/Analysis/Verifier.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Intrinsics.h" #include "llvm/Instructions.h" +#endif +#include "llvm/Analysis/Verifier.h" #include "llvm/ExecutionEngine/JIT.h" #include "llvm/ExecutionEngine/Interpreter.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/raw_ostream.h" -#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 2) +#if (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 3) +#include "llvm/IR/IRBuilder.h" +#elif (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR ==2) #include "llvm/IRBuilder.h" #else #include "llvm/Support/IRBuilder.h" diff --git a/gb.jit/src/jit_codegen.cpp b/gb.jit/src/jit_codegen.cpp index 8e80e5b38..35e1f9942 100644 --- a/gb.jit/src/jit_codegen.cpp +++ b/gb.jit/src/jit_codegen.cpp @@ -3614,7 +3614,7 @@ void TryExpression::codegen(){ create_gep(temp_errcontext1, TARGET_BITS, 0, TARGET_BITS, 0)); llvm::Function* f = llvm::cast(get_global_function(_setjmp, 'i', "p")); -#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 2) +#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 2) f->addFnAttr(llvm::Attributes::ReturnsTwice); #else f->addFnAttr(llvm::Attribute::ReturnsTwice); @@ -3669,7 +3669,7 @@ void LargeTryExpression::codegen(){ create_gep(temp_errcontext2, TARGET_BITS, 0, TARGET_BITS, 0)); llvm::Function* f = llvm::cast(get_global_function(_setjmp, 'i', "p")); -#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 2) +#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 2) f->addFnAttr(llvm::Attributes::ReturnsTwice); #else f->addFnAttr(llvm::Attribute::ReturnsTwice); diff --git a/gb.jit/src/jit_gambas_pass.cpp b/gb.jit/src/jit_gambas_pass.cpp index 9e2268bbe..239a3027b 100644 --- a/gb.jit/src/jit_gambas_pass.cpp +++ b/gb.jit/src/jit_gambas_pass.cpp @@ -24,9 +24,12 @@ ***************************************************************************/ #include "llvm/Pass.h" -#include "llvm/Function.h" -#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 2) +#if (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 3) +#include "llvm/IR/IRBuilder.h" +#include "llvm/IR/Function.h" +#elif (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 2) #include "llvm/IRBuilder.h" +#include "llvm/Function.h" #else #include "llvm/Support/IRBuilder.h" #endif