diff options
author | Luo Xionghu <xionghu.luo@intel.com> | 2015-12-10 16:33:54 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-12-10 17:02:58 +0800 |
commit | b51dd736527ee769a9665d83a1b4e7dc6438e67c (patch) | |
tree | 50b1ddc07baeb69dea9f88fe6885068bd5d41479 | |
parent | 395fe59f2324a8f39f27432058794b5ed24d40b7 (diff) |
fix LLVM 3.5 fail.
aslo call llvm::WriteBitcodeToFile for -dump-spir-binary option
under LLVM 3.5.
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r-- | backend/src/backend/program.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp index daf6af03..14b802a4 100644 --- a/backend/src/backend/program.cpp +++ b/backend/src/backend/program.cpp @@ -667,6 +667,20 @@ namespace gbe { (*out_module)->print(ostream, 0); } //Otherwise, you'll have to make do without the dump. } + + if (!dumpSPIRBinaryName.empty()) { + std::string err; + llvm::raw_fd_ostream ostream (dumpSPIRBinaryName.c_str(), + err, + #if LLVM_VERSION_MINOR == 3 + 0 + #else + llvm::sys::fs::F_None + #endif + ); + if (err.empty()) + llvm::WriteBitcodeToFile(*out_module, ostream); + } #else if (!dumpLLVMFileName.empty()) { std::error_code err; |