aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Hosek <phosek@google.com>2024-03-12 19:33:16 -0700
committerGitHub <noreply@github.com>2024-03-12 22:33:16 -0400
commit34cf6847752a3aad68eaa889ab6e0073a38fc2db (patch)
treebed7b90d0c7334d51c97745ced2c7848f3b35f77
parent096d061c1c2f91edef7186bd8b61067020f49898 (diff)
downloadllvm-34cf6847752a3aad68eaa889ab6e0073a38fc2db.zip
llvm-34cf6847752a3aad68eaa889ab6e0073a38fc2db.tar.gz
llvm-34cf6847752a3aad68eaa889ab6e0073a38fc2db.tar.bz2
[libc] Move `struct timespec` from POSIX to StdC (#85010)
`struct timespec` is actually defined in the C standard, not POSIX.
-rw-r--r--libc/spec/posix.td4
-rw-r--r--libc/spec/spec.td4
-rw-r--r--libc/spec/stdc.td1
3 files changed, 5 insertions, 4 deletions
diff --git a/libc/spec/posix.td b/libc/spec/posix.td
index d0f5a45..591919a 100644
--- a/libc/spec/posix.td
+++ b/libc/spec/posix.td
@@ -42,10 +42,6 @@ def StructDirentPtr : PtrType<StructDirent>;
def StructDirentPtrPtr : PtrType<StructDirentPtr>;
def ConstStructDirentPtrPtr : ConstType<StructDirentPtrPtr>;
-def StructTimeSpec : NamedType<"struct timespec">;
-def StructTimeSpecPtr : PtrType<StructTimeSpec>;
-def ConstStructTimeSpecPtr : ConstType<StructTimeSpecPtr>;
-
def StructSchedParam : NamedType<"struct sched_param">;
def StructSchedParamPtr : PtrType<StructSchedParam>;
def ConstStructSchedParamPtr : ConstType<StructSchedParamPtr>;
diff --git a/libc/spec/spec.td b/libc/spec/spec.td
index a44a7ae..580bd9c 100644
--- a/libc/spec/spec.td
+++ b/libc/spec/spec.td
@@ -118,6 +118,10 @@ def SigHandlerT : NamedType<"__sighandler_t">;
def TimeTType : NamedType<"time_t">;
+def StructTimeSpec : NamedType<"struct timespec">;
+def StructTimeSpecPtr : PtrType<StructTimeSpec>;
+def ConstStructTimeSpecPtr : ConstType<StructTimeSpecPtr>;
+
def BSearchCompareT : NamedType<"__bsearchcompare_t">;
def QSortCompareT : NamedType<"__qsortcompare_t">;
diff --git a/libc/spec/stdc.td b/libc/spec/stdc.td
index e012d0d..e8f73dd 100644
--- a/libc/spec/stdc.td
+++ b/libc/spec/stdc.td
@@ -1202,6 +1202,7 @@ def StdC : StandardSpec<"stdc"> {
[ // Types
ClockT,
StructTmType,
+ StructTimeSpec,
TimeTType,
],
[], // Enumerations