summaryrefslogtreecommitdiff
path: root/libc/utils
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2023-04-16 05:40:07 +0000
committerSiva Chandra Reddy <sivachandra@google.com>2023-04-17 05:20:53 +0000
commitdf8c78c5b5c0c41de7c5e274406c2e292c3f0259 (patch)
tree482b51f0312bf874e98da8790b76d951b69ee64d /libc/utils
parent06387f94cfdf6bbd37ac3b925a50410e11a1fc9d (diff)
downloadllvm-df8c78c5b5c0c41de7c5e274406c2e292c3f0259.tar.gz
[libc][NFC] Remove use of StreamWrapper from math differential tests.
Along the way, the utility Timer has been moved to the math differential test directory. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D148450
Diffstat (limited to 'libc/utils')
-rw-r--r--libc/utils/testutils/CMakeLists.txt2
-rw-r--r--libc/utils/testutils/Timer.cpp42
-rw-r--r--libc/utils/testutils/Timer.h33
3 files changed, 0 insertions, 77 deletions
diff --git a/libc/utils/testutils/CMakeLists.txt b/libc/utils/testutils/CMakeLists.txt
index 616a01f44de2..2d36ae581673 100644
--- a/libc/utils/testutils/CMakeLists.txt
+++ b/libc/utils/testutils/CMakeLists.txt
@@ -13,7 +13,5 @@ add_library(
ExecuteFunction.h
${FDReaderFile}
FDReader.h
- Timer.h
- Timer.cpp
RoundingModeUtils.cpp
)
diff --git a/libc/utils/testutils/Timer.cpp b/libc/utils/testutils/Timer.cpp
deleted file mode 100644
index 6780389d5322..000000000000
--- a/libc/utils/testutils/Timer.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//===-- Timer.cpp --------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "Timer.h"
-
-#include <chrono>
-#include <fstream>
-
-namespace __llvm_libc {
-namespace testing {
-
-struct TimerImplementation {
- std::chrono::high_resolution_clock::time_point Start;
- std::chrono::high_resolution_clock::time_point End;
-};
-
-Timer::Timer() : Impl(new TimerImplementation) {}
-
-Timer::~Timer() { delete reinterpret_cast<TimerImplementation *>(Impl); }
-
-void Timer::start() {
- auto T = reinterpret_cast<TimerImplementation *>(Impl);
- T->Start = std::chrono::high_resolution_clock::now();
-}
-
-void Timer::stop() {
- auto T = reinterpret_cast<TimerImplementation *>(Impl);
- T->End = std::chrono::high_resolution_clock::now();
-}
-
-uint64_t Timer::nanoseconds() const {
- auto T = reinterpret_cast<TimerImplementation *>(Impl);
- return std::chrono::nanoseconds(T->End - T->Start).count();
-}
-
-} // namespace testing
-} // namespace __llvm_libc
diff --git a/libc/utils/testutils/Timer.h b/libc/utils/testutils/Timer.h
deleted file mode 100644
index 9df13a0d4074..000000000000
--- a/libc/utils/testutils/Timer.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//===-- Timer.h -------------------------------------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_UTILS_TESTUTILS_TIMER_H
-#define LLVM_LIBC_UTILS_TESTUTILS_TIMER_H
-
-#include <stdint.h>
-
-namespace __llvm_libc {
-namespace testing {
-
-class Timer {
- void *Impl;
-
-public:
- Timer();
- ~Timer();
-
- void start();
- void stop();
-
- uint64_t nanoseconds() const;
-};
-
-} // namespace testing
-} // namespace __llvm_libc
-
-#endif // LLVM_LIBC_UTILS_TESTUTILS_TIMER_H