From f326c6aab9ac1b38016076a1d0ff5b55e0813b87 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Sun, 2 Sep 2018 13:25:06 +0200 Subject: llvm7: adapt to new openFileForWrite In llvm commit 03bcb2143b5c, OpenFlags were split and openFileForWrite accepts one more parameter. Fortunately, openFileForWrite now defaults to F_None, so we remove the parameter completely from llvm 3.7 and later. Signed-off-by: Jiri Slaby --- lib/Support/CompressionStream.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Support') diff --git a/lib/Support/CompressionStream.cpp b/lib/Support/CompressionStream.cpp index d17e1df1..ff2d290f 100644 --- a/lib/Support/CompressionStream.cpp +++ b/lib/Support/CompressionStream.cpp @@ -28,7 +28,10 @@ compressed_fd_ostream::compressed_fd_ostream(const std::string &Filename, : llvm::raw_ostream(), pos(0) { ErrorInfo = ""; // Open file in binary mode -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) +#if LLVM_VERSION_CODE >= LLVM_VERSION(7, 0) + std::error_code EC = + llvm::sys::fs::openFileForWrite(Filename, FD); +#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) std::error_code EC = llvm::sys::fs::openFileForWrite(Filename, FD, llvm::sys::fs::F_None); #else -- cgit 1.4.1