about summary refs log tree commit diff homepage
path: root/lib/Support
diff options
context:
space:
mode:
authorLukas Zaoral <lzaoral@redhat.com>2021-08-24 13:59:28 +0200
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2021-12-20 14:36:51 +0000
commit90b40d50f0f15ecfcf84fa0a95e2f7aaddf4ace4 (patch)
treef758c400d22edd595ac1361fc5ed3d889c189857 /lib/Support
parentd27ecd8e9290699f618d3f035181bc2fe6025f55 (diff)
downloadklee-90b40d50f0f15ecfcf84fa0a95e2f7aaddf4ace4.tar.gz
llvm13: llvm::fs::F_None has been removed
... and should be replaced with llvm::fs::OF_None since LLVM 7.

See: https://reviews.llvm.org/D101506
     https://github.com/llvm/llvm-project/commit/1f67a3cba9b09636c56e2109d8a35ae96dc15782
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/FileHandling.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Support/FileHandling.cpp b/lib/Support/FileHandling.cpp
index 9809b87d..46205521 100644
--- a/lib/Support/FileHandling.cpp
+++ b/lib/Support/FileHandling.cpp
@@ -24,8 +24,15 @@ std::unique_ptr<llvm::raw_fd_ostream>
 klee_open_output_file(const std::string &path, std::string &error) {
   error.clear();
   std::error_code ec;
+
+#if LLVM_VERSION_CODE >= LLVM_VERSION(7, 0)
+  auto f = std::make_unique<llvm::raw_fd_ostream>(path.c_str(), ec,
+                                                  llvm::sys::fs::OF_None);
+#else
   auto f = std::make_unique<llvm::raw_fd_ostream>(path.c_str(), ec,
                                                   llvm::sys::fs::F_None);
+#endif
+
   if (ec)
     error = ec.message();
   if (!error.empty()) {