Mercurial > octave
changeset 24244:9eef7983b9bc
jit: pt-jit.cc: Fix llvm::raw_fd_ostream syntax
* libinterp/corefcn/pt-jit.cc: Fix llvm::raw_fd_ostream syntax for use with LLVM
3.6 and later. FIXME: Check final arg. FIXME: autoconf.
author | Julien Bect <jbect@users.sourceforge.net> |
---|---|
date | Mon, 24 Jul 2017 13:54:24 +0200 |
parents | 735ebdfdb7d4 |
children | b3b7677334f6 |
files | libinterp/parse-tree/pt-jit.cc |
diffstat | 1 files changed, 11 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-jit.cc Sun Jul 23 18:56:18 2017 +0200 +++ b/libinterp/parse-tree/pt-jit.cc Mon Jul 24 13:54:24 2017 +0200 @@ -2187,14 +2187,17 @@ if (Vdebug_jit) { - std::string error; -#if defined (RAW_FD_OSTREAM_ARG_IS_LLVM_SYS_FS) - llvm::raw_fd_ostream fout ("test.bc", error, - llvm::sys::fs::F_Binary); -#else - llvm::raw_fd_ostream fout ("test.bc", error, - llvm::raw_fd_ostream::F_Binary); -#endif + // This should be OK in LLVM 3.6 -- 3.8 (and later ?) + std::error_code ec; + llvm::raw_fd_ostream fout ("test.bc", ec, llvm::sys::fs::F_None); + + // std::string error; + //#if defined (RAW_FD_OSTREAM_ARG_IS_LLVM_SYS_FS) + // llvm::raw_fd_ostream fout ("test.bc", error, llvm::sys::fs::F_Binary); + //#else + // llvm::raw_fd_ostream fout ("test.bc", error, llvm::raw_fd_ostream::F_Binary); + //#endif + llvm::WriteBitcodeToFile (module, fout); } }