[Beignet] [PATCH] Fix llvm3.6 build error.

Yang Rong rong.r.yang at intel.com
Mon Mar 2 20:53:43 PST 2015


LLVM3.6 revert the c api LLVMLinkModules to LLVM3.5 last-minute. Consist with it.
---
 backend/src/backend/gen_program.cpp    | 4 ----
 backend/src/llvm/llvm_bitcode_link.cpp | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp
index 2525825..755c60e 100644
--- a/backend/src/backend/gen_program.cpp
+++ b/backend/src/backend/gen_program.cpp
@@ -388,11 +388,7 @@ namespace gbe {
       llvm::Module* src = (llvm::Module*)((GenProgram*)src_program)->module;
       llvm::Module* dst = (llvm::Module*)((GenProgram*)dst_program)->module;
 
-#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR <= 5
       if (LLVMLinkModules(wrap(dst), wrap(src), LLVMLinkerPreserveSource, &errMsg)) {
-#else
-      if (LLVMLinkModules(wrap(dst), wrap(src), 0, &errMsg)) {
-#endif
         if (err != NULL && errSize != NULL && stringSize > 0u) {
           strncpy(err, errMsg, stringSize-1);
           err[stringSize-1] = '\0';
diff --git a/backend/src/llvm/llvm_bitcode_link.cpp b/backend/src/llvm/llvm_bitcode_link.cpp
index 96f7781..17248c0 100644
--- a/backend/src/llvm/llvm_bitcode_link.cpp
+++ b/backend/src/llvm/llvm_bitcode_link.cpp
@@ -240,11 +240,7 @@ namespace gbe
     /* We use beignet's bitcode as dst because it will have a lot of
        lazy functions which will not be loaded. */
     char* errorMsg;
-#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR <= 5
     if(LLVMLinkModules(wrap(clonedLib), wrap(mod), LLVMLinkerDestroySource, &errorMsg)) {
-#else
-    if(LLVMLinkModules(wrap(clonedLib), wrap(mod), 0, &errorMsg)) {
-#endif
       delete clonedLib;
       printf("Fatal Error: link the bitcode error:\n%s\n", errorMsg);
       return NULL;
-- 
2.1.0



More information about the Beignet mailing list