[PATCH] D61768: [compiler-rt] Migrate to _zx_clock_get_new/_zx_clock_get_monotonic

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 16:31:36 PDT 2019


phosek updated this revision to Diff 198940.

Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61768/new/

https://reviews.llvm.org/D61768

Files:
  compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc


Index: compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc
+++ compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc
@@ -46,9 +46,14 @@
   return 0;
 }
 
-u64 NanoTime() { return _zx_clock_get(ZX_CLOCK_UTC); }
+u64 NanoTime() {
+  zx_time_t time;
+  zx_status_t status = _zx_clock_get_new(ZX_CLOCK_UTC, &time);
+  CHECK_EQ(status, ZX_OK);
+  return static_cast<u64>(time);
+}
 
-u64 MonotonicNanoTime() { return _zx_clock_get(ZX_CLOCK_MONOTONIC); }
+u64 MonotonicNanoTime() { return _zx_clock_get_monotonic(); }
 
 uptr internal_getpid() {
   zx_info_handle_basic_t info;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61768.198940.patch
Type: text/x-patch
Size: 700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190509/3d92dd8c/attachment.bin>


More information about the llvm-commits mailing list