summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMake/FindLLVM.cmake4
-rw-r--r--backend/src/backend/program.cpp7
-rw-r--r--backend/src/llvm/llvm_gen_backend.cpp6
-rw-r--r--docs/Beignet.mdwn2
4 files changed, 12 insertions, 7 deletions
diff --git a/CMake/FindLLVM.cmake b/CMake/FindLLVM.cmake
index e76ab429..3fa9ad91 100644
--- a/CMake/FindLLVM.cmake
+++ b/CMake/FindLLVM.cmake
@@ -7,9 +7,9 @@
# LLVM_MODULE_LIBS - list of llvm libs for working with modules.
# LLVM_FOUND - True if llvm found.
if (LLVM_INSTALL_DIR)
- find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-32 llvm-config-3.2 llvm-config-31 llvm-config-3.1 llvm-config DOC "llvm-config executable" PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
+ find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-32 llvm-config-3.2 llvm-config-31 llvm-config-3.1 llvm-config-3.4 llvm-config DOC "llvm-config executable" PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
else (LLVM_INSTALL_DIR)
- find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-32 llvm-config-3.2 llvm-config-31 llvm-config-3.1 llvm-config DOC "llvm-config executable")
+ find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-32 llvm-config-3.2 llvm-config-31 llvm-config-3.1 llvm-config-3.4 llvm-config DOC "llvm-config executable")
endif (LLVM_INSTALL_DIR)
if (LLVM_CONFIG_EXECUTABLE)
diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
index 6550eac4..6ba9593e 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -542,7 +542,12 @@ namespace gbe {
llvm::Module *module = Act->takeModule();
std::string ErrorInfo;
- llvm::raw_fd_ostream OS(output, ErrorInfo,llvm::raw_fd_ostream::F_Binary);
+#if (LLVM_VERSION_MAJOR == 3) && (LLVM_VERSION_MINOR > 3)
+ auto mode = llvm::sys::fs::F_Binary;
+#else
+ auto mode = llvm::raw_fd_ostream::F_Binary;
+#endif
+ llvm::raw_fd_ostream OS(output, ErrorInfo, mode);
//still write to temp file for code simply, otherwise need add another function.
//because gbe_program_new_from_llvm also be used by cl_program_create_from_llvm, can't be removed
//TODO: Pass module to llvmToGen, if use module, should return Act and use OwningPtr out of this funciton
diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index 5b6857d8..1fb3fd67 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -154,9 +154,9 @@
#define LLVM_VERSION_MINOR 0
#endif /* !defined(LLVM_VERSION_MINOR) */
-#if (LLVM_VERSION_MAJOR != 3) || (LLVM_VERSION_MINOR > 3)
-#error "Only LLVM 3.0 - 3.3 is supported"
-#endif /* (LLVM_VERSION_MAJOR != 3) || (LLVM_VERSION_MINOR > 3) */
+#if (LLVM_VERSION_MAJOR != 3) || (LLVM_VERSION_MINOR > 4)
+#error "Only LLVM 3.0 - 3.4 is supported"
+#endif /* (LLVM_VERSION_MAJOR != 3) || (LLVM_VERSION_MINOR > 4) */
using namespace llvm;
diff --git a/docs/Beignet.mdwn b/docs/Beignet.mdwn
index c0f88de1..86a235ea 100644
--- a/docs/Beignet.mdwn
+++ b/docs/Beignet.mdwn
@@ -55,7 +55,7 @@ with any thing older.
[http://llvm.org/releases/](http://llvm.org/releases/)
-LLVM 3.1,3.2 and 3.3 are supported.
+LLVM 3.1,3.2,3.3 and 3.4 are supported.
Also note that the code was compiled on GCC 4.6 and GCC 4.7. Since the code uses
really recent C++11 features, you may expect problems with older compilers. Last