fix issue when build against llvm3.4

Submitted by Manasi Navare on Aug. 18, 2015, 10:54 p.m.


Message ID
State New
Headers show

Not browsing as part of any series.

Commit Message

Manasi Navare Aug. 18, 2015, 10:54 p.m.
Hi Yejun,

I tried this change on my end. But if we give F_None as the OpenFlags then it is not creating the file specified in the dumpllvmFilename. I am testing agaist llvm 3.5
I am guessing that is happening because if F_NONE is specified it defaults to O_CREAT option but to be able to read this file offline, we need O_RW.


-----Original Message-----
From: Beignet [] On Behalf Of Guo Yejun

Sent: Monday, August 17, 2015 3:51 PM
Cc: Guo, Yejun
Subject: [Beignet] [PATCH] fix issue when build against llvm3.4

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

 backend/src/backend/program.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


Beignet mailing list

Patch hide | download patch | download mbox

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
-                                      llvm::sys::fs::F_RW
+                                      llvm::sys::fs::F_None
         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.