[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:41:58 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL360394: [compiler-rt] Migrate to _zx_clock_get_new/_zx_clock_get_monotonic (authored by phosek, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D61768?vs=198942&id=198943#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61768

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


Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc
+++ compiler-rt/trunk/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 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.198943.patch
Type: text/x-patch
Size: 700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190509/b2eb57b8/attachment.bin>


More information about the llvm-commits mailing list