Skip to content

Commit 9fd052a

Browse files
committed
Revert "[libc][windows] start time API implementation (#117775)"
This reverts commit 0adff0a. Breaks the GPU build
1 parent 0550480 commit 9fd052a

File tree

26 files changed

+47
-248
lines changed

26 files changed

+47
-248
lines changed

libc/config/windows/entrypoints.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ set(TARGET_LIBC_ENTRYPOINTS
9595

9696
# errno.h entrypoints
9797
libc.src.errno.errno
98-
99-
# time.h entrypoints
100-
libc.src.time.time
10198
)
10299

103100
set(TARGET_LIBM_ENTRYPOINTS

libc/hdr/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,10 @@ add_proxy_header_library(
135135
libc.include.llvm-libc-macros.unistd_macros
136136
)
137137

138-
if (WIN32)
139-
set(windows_addtional_time_macros libc.include.llvm-libc-macros.windows.time_macros_ext)
140-
else()
141-
set(windows_addtional_time_macros "")
142-
endif()
143-
144138
add_proxy_header_library(
145139
time_macros
146140
HDRS
147141
time_macros.h
148-
DEPENDS
149-
${windows_addtional_time_macros}
150142
FULL_BUILD_DEPENDS
151143
libc.include.time
152144
libc.include.llvm-libc-macros.time_macros

libc/hdr/time_macros.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,4 @@
1919

2020
#endif // LLVM_LIBC_FULL_BUILD
2121

22-
// TODO: For now, on windows, let's always include the extension header.
23-
// We will need to decide how to export this header.
24-
#ifdef _WIN32
25-
#include "include/llvm-libc-macros/windows/time-macros-ext.h"
26-
#endif // _WIN32
27-
2822
#endif // LLVM_LIBC_HDR_TIME_MACROS_H

libc/hdr/types/clockid_t.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
#ifndef LLVM_LIBC_HDR_TYPES_CLOCKID_T_H
1010
#define LLVM_LIBC_HDR_TYPES_CLOCKID_T_H
1111

12-
// TODO: we will need to decide how to export extension to windows.
13-
#if defined(LIBC_FULL_BUILD) || defined(_WIN32)
12+
#ifdef LIBC_FULL_BUILD
1413

1514
#include "include/llvm-libc-types/clockid_t.h"
1615

libc/include/llvm-libc-macros/windows/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

libc/include/llvm-libc-macros/windows/time-macros-ext.h

Lines changed: 0 additions & 17 deletions
This file was deleted.

libc/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ add_subdirectory(stdio)
1313
add_subdirectory(stdlib)
1414
add_subdirectory(string)
1515
add_subdirectory(wchar)
16-
add_subdirectory(time)
1716

1817
if(${LIBC_TARGET_OS} STREQUAL "linux")
1918
add_subdirectory(dirent)
@@ -41,4 +40,5 @@ add_subdirectory(setjmp)
4140
add_subdirectory(signal)
4241
add_subdirectory(spawn)
4342
add_subdirectory(threads)
43+
add_subdirectory(time)
4444
add_subdirectory(locale)

libc/src/__support/time/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
22
add_subdirectory(${LIBC_TARGET_OS})
33
endif()
44

5-
add_object_library(
6-
clock_gettime
7-
ALIAS
8-
DEPENDS
9-
libc.src.__support.time.${LIBC_TARGET_OS}.clock_gettime
10-
)
11-
125
add_header_library(
136
units
147
HDRS

libc/src/__support/time/linux/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
add_object_library(
22
clock_gettime
33
HDRS
4-
../clock_gettime.h
4+
clock_gettime.h
55
SRCS
66
clock_gettime.cpp
77
DEPENDS

libc/src/__support/time/linux/clock_conversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define LLVM_LIBC_SRC___SUPPORT_TIME_LINUX_CLOCK_CONVERSION_H
1111

1212
#include "src/__support/macros/config.h"
13-
#include "src/__support/time/clock_gettime.h"
13+
#include "src/__support/time/linux/clock_gettime.h"
1414
#include "src/__support/time/units.h"
1515

1616
namespace LIBC_NAMESPACE_DECL {

libc/src/__support/time/linux/clock_gettime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/time/clock_gettime.h"
9+
#include "src/__support/time/linux/clock_gettime.h"
1010
#include "hdr/types/clockid_t.h"
1111
#include "hdr/types/struct_timespec.h"
1212
#include "src/__support/OSUtil/linux/vdso.h"

libc/src/__support/time/clock_gettime.h renamed to libc/src/__support/time/linux/clock_gettime.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_SRC___SUPPORT_TIME_CLOCK_GETTIME_H
10-
#define LLVM_LIBC_SRC___SUPPORT_TIME_CLOCK_GETTIME_H
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_TIME_LINUX_CLOCK_GETTIME_H
10+
#define LLVM_LIBC_SRC___SUPPORT_TIME_LINUX_CLOCK_GETTIME_H
1111

1212
#include "hdr/types/clockid_t.h"
1313
#include "hdr/types/struct_timespec.h"
1414
#include "src/__support/error_or.h"
1515

16+
#if defined(SYS_clock_gettime64)
17+
#include <linux/time_types.h>
18+
#endif
19+
1620
namespace LIBC_NAMESPACE_DECL {
1721
namespace internal {
1822
ErrorOr<int> clock_gettime(clockid_t clockid, timespec *ts);
1923
} // namespace internal
2024
} // namespace LIBC_NAMESPACE_DECL
2125

22-
#endif // LLVM_LIBC_SRC___SUPPORT_TIME_CLOCK_GETTIME_H
26+
#endif // LLVM_LIBC_SRC___SUPPORT_TIME_LINUX_CLOCK_GETTIME_H

libc/src/__support/time/windows/CMakeLists.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

libc/src/__support/time/windows/clock_gettime.cpp

Lines changed: 0 additions & 150 deletions
This file was deleted.

libc/src/time/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,9 @@ add_entrypoint_object(
106106

107107
add_entrypoint_object(
108108
time
109-
SRCS
110-
time.cpp
111-
HDRS
112-
time_func.h
109+
ALIAS
113110
DEPENDS
114-
libc.hdr.time_macros
115-
libc.hdr.types.time_t
116-
libc.src.__support.time.clock_gettime
117-
libc.src.errno.errno
111+
.${LIBC_TARGET_OS}.time
118112
)
119113

120114
add_entrypoint_object(

libc/src/time/linux/CMakeLists.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
add_entrypoint_object(
2+
time
3+
SRCS
4+
time.cpp
5+
HDRS
6+
../time_func.h
7+
DEPENDS
8+
libc.hdr.time_macros
9+
libc.hdr.types.time_t
10+
libc.src.__support.time.linux.clock_gettime
11+
libc.src.errno.errno
12+
)
13+
114
add_entrypoint_object(
215
timespec_get
316
SRCS
@@ -7,7 +20,7 @@ add_entrypoint_object(
720
DEPENDS
821
libc.hdr.time_macros
922
libc.hdr.types.struct_timespec
10-
libc.src.__support.time.clock_gettime
23+
libc.src.__support.time.linux.clock_gettime
1124
libc.src.errno.errno
1225
)
1326

@@ -21,7 +34,7 @@ add_entrypoint_object(
2134
libc.hdr.time_macros
2235
libc.hdr.types.clock_t
2336
libc.src.__support.time.units
24-
libc.src.__support.time.clock_gettime
37+
libc.src.__support.time.linux.clock_gettime
2538
libc.src.__support.CPP.limits
2639
libc.src.errno.errno
2740
)
@@ -49,7 +62,7 @@ add_entrypoint_object(
4962
DEPENDS
5063
libc.hdr.types.clockid_t
5164
libc.hdr.types.struct_timespec
52-
libc.src.__support.time.clock_gettime
65+
libc.src.__support.time.linux.clock_gettime
5366
libc.src.errno.errno
5467
)
5568

@@ -62,7 +75,7 @@ add_entrypoint_object(
6275
DEPENDS
6376
libc.hdr.time_macros
6477
libc.hdr.types.suseconds_t
65-
libc.src.__support.time.clock_gettime
78+
libc.src.__support.time.linux.clock_gettime
6679
libc.src.__support.time.units
6780
libc.src.errno.errno
6881
)

0 commit comments

Comments
 (0)