[Beignet] [PATCH] fix issue when build against llvm3.4

Guo Yejun yejun.guo at intel.com
Mon Aug 17 15:51:28 PDT 2015


the defines inside 'enum OpenFlags' changed from llvm 3.4 to 3.5,
since we are creating a file for write, just use llvm::sys::fs::F_None
which is defined by both 3.4 and 3.5

also change the flag to F_None for llvm3.6, since the it is not necessary
to use F_RW.

Signed-off-by: Guo Yejun <yejun.guo at intel.com>
---
 backend/src/backend/program.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
index c02096f..0c662c0 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -828,7 +828,7 @@ namespace gbe {
         #if LLVM_VERSION_MINOR == 3
                                       0
         #else
-                                      llvm::sys::fs::F_RW
+                                      llvm::sys::fs::F_None
         #endif
                                       );
         if (err.empty()) {
@@ -839,7 +839,7 @@ namespace gbe {
       if (!dumpLLVMFileName.empty()) {
         std::error_code err;
         llvm::raw_fd_ostream ostream (dumpLLVMFileName.c_str(),
-                                      err, llvm::sys::fs::F_RW);
+                                      err, llvm::sys::fs::F_None);
         if (!err) {
           out_module->print(ostream, 0);
         } //Otherwise, you'll have to make do without the dump.
-- 
1.9.1



More information about the Beignet mailing list