* BUG: Fix building with llvm 3.3

It should still build with llvm-3.2 (not tested)


git-svn-id: svn://localhost/gambas/trunk@5700 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Laurent Carlier 2013-06-13 11:55:04 +00:00
parent 8ca73977d0
commit 922b32a89c
3 changed files with 21 additions and 6 deletions

View file

@ -26,20 +26,32 @@
#ifndef __JIT_H
#define __JIT_H
#include <llvm/Config/llvm-config.h>
#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"

View file

@ -3614,7 +3614,7 @@ void TryExpression::codegen(){
create_gep(temp_errcontext1, TARGET_BITS, 0, TARGET_BITS, 0));
llvm::Function* f = llvm::cast<llvm::Function>(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<llvm::Function>(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);

View file

@ -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