[pkg-d-commits] [ldc] 159/211: Fix LLM 4.0 build. (#1895)

Matthias Klumpp mak at moszumanska.debian.org
Sun Apr 23 22:36:19 UTC 2017


This is an automated email from the git hooks/post-receive script.

mak pushed a commit to annotated tag v1.1.0
in repository ldc.

commit 89e29b61bcafb67a3e03cfca87cf4bd05d50ae8c
Author: Johan Engelen <jbc.engelen at gmail.com>
Date:   Fri Nov 25 11:40:45 2016 +0100

    Fix LLM 4.0 build. (#1895)
---
 driver/cache.cpp | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/driver/cache.cpp b/driver/cache.cpp
index 6da78cf..2ca64c1 100644
--- a/driver/cache.cpp
+++ b/driver/cache.cpp
@@ -38,14 +38,15 @@
 
 #if LDC_LLVM_VER >= 400
 #include "llvm/Bitcode/BitcodeWriter.h"
+#include "llvm/Support/Chrono.h"
 #else
 #include "llvm/Bitcode/ReaderWriter.h"
+#include "llvm/Support/TimeValue.h"
 #endif
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/MD5.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/TimeValue.h"
 
 // Include close() declaration.
 #if !defined(_MSC_VER) && !defined(__MINGW32__)
@@ -98,6 +99,15 @@ bool isPruningEnabled() {
   return false;
 }
 
+#if LDC_LLVM_VER >= 400
+llvm::sys::TimePoint<std::chrono::seconds> getTimeNow() {
+  using namespace std::chrono;
+  return time_point_cast<seconds>(system_clock::now());
+}
+#else
+llvm::sys::TimeValue getTimeNow() { return llvm::sys::TimeValue::now(); }
+#endif
+
 /// A raw_ostream that creates a hash of what is written to it.
 /// This class does not encounter output errors.
 /// There is no buffering and the hasher can be used at any time.
@@ -335,8 +345,7 @@ void recoverObjectFile(llvm::StringRef cacheObjectHash,
       fatal();
     }
 
-    if (llvm::sys::fs::setLastModificationAndAccessTime(
-            FD, llvm::sys::TimeValue::now())) {
+    if (llvm::sys::fs::setLastModificationAndAccessTime(FD, getTimeNow())) {
       error(Loc(), "Failed to set the cached file modification time: %s",
             cacheFile.c_str());
       fatal();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git



More information about the pkg-d-commits mailing list