<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/time/time_utils.h, branch users/mingmingl-llvm/samplefdo-profile-format</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[libc] implement template functions for localtime (#110363)</title>
<updated>2025-09-03T21:55:02+00:00</updated>
<author>
<name>Zishan Mirza</name>
<email>zmirza@posteo.ch</email>
</author>
<published>2025-09-03T21:55:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=17bddd12245324311d10a681d606961914174c88'/>
<id>17bddd12245324311d10a681d606961914174c88</id>
<content type='text'>
This is an implementation for template functions of localtime.

Update for this pull request: Implementation as been removed from this
pull request and will be added to a new one. This is because this pull
request is getting big. This pull request will only contain template
functions in order to implement localtime.

Update: The implementation is available in
https://github.com/zimirza/llvm-project/tree/localtime_implementation.

---------

Co-authored-by: Зишан Мирза &lt;zmirza@tutanota.de&gt;
Co-authored-by: Zishan Mirza &lt;zmirza@posteo.de&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is an implementation for template functions of localtime.

Update for this pull request: Implementation as been removed from this
pull request and will be added to a new one. This is because this pull
request is getting big. This pull request will only contain template
functions in order to implement localtime.

Update: The implementation is available in
https://github.com/zimirza/llvm-project/tree/localtime_implementation.

---------

Co-authored-by: Зишан Мирза &lt;zmirza@tutanota.de&gt;
Co-authored-by: Zishan Mirza &lt;zmirza@posteo.de&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][NFC] Add stdint.h proxy header to fix dependency issue with &lt;stdint.h&gt; includes. (#150303)</title>
<updated>2025-07-24T00:19:52+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-07-24T00:19:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=66603dd1f10e0f6c0510273378334971159f6b69'/>
<id>66603dd1f10e0f6c0510273378334971159f6b69</id>
<content type='text'>
https://github.com/llvm/llvm-project/issues/149993</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/issues/149993</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187)</title>
<updated>2025-06-11T20:25:27+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-06-11T20:25:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d87eea35fac5a34a841c637db8908128409a184e'/>
<id>d87eea35fac5a34a841c637db8908128409a184e</id>
<content type='text'>
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] change the return value type of mktime_internal to time_t (#132231)</title>
<updated>2025-03-25T14:09:15+00:00</updated>
<author>
<name>Leslie</name>
<email>Wse1714401046@gmail.com</email>
</author>
<published>2025-03-25T14:09:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ba46c37f9c56cb207c0c7189246456edef563340'/>
<id>ba46c37f9c56cb207c0c7189246456edef563340</id>
<content type='text'>
This pr is to resovle #126948

---------

Co-authored-by: Joseph Huber &lt;huberjn@outlook.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This pr is to resovle #126948

---------

Co-authored-by: Joseph Huber &lt;huberjn@outlook.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix implict cast to time_t warning (#126947)</title>
<updated>2025-02-12T18:08:06+00:00</updated>
<author>
<name>Michael Jones</name>
<email>michaelrj@google.com</email>
</author>
<published>2025-02-12T18:08:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=16a5f7eb73f225544d29e613c84011f1e1ec53a4'/>
<id>16a5f7eb73f225544d29e613c84011f1e1ec53a4</id>
<content type='text'>
On some systems time_t is 32 bit, causing build errors (with -Werror)
in get_epoch which attempts to implicitly convert an int64_t to a
time_t.

Fixes:

error: implicit conversion loses integer precision: 'int64_t' (aka 'long
long') to 'time_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
      332 |     return mktime_internal(timeptr);
          |     ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On some systems time_t is 32 bit, causing build errors (with -Werror)
in get_epoch which attempts to implicitly convert an int64_t to a
time_t.

Fixes:

error: implicit conversion loses integer precision: 'int64_t' (aka 'long
long') to 'time_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
      332 |     return mktime_internal(timeptr);
          |     ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] fix get_epoch constexpr error (#126818)</title>
<updated>2025-02-12T00:08:20+00:00</updated>
<author>
<name>Michael Jones</name>
<email>michaelrj@google.com</email>
</author>
<published>2025-02-12T00:08:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=574ccc6d1b85e9e93b674152ab60df3b0deed86f'/>
<id>574ccc6d1b85e9e93b674152ab60df3b0deed86f</id>
<content type='text'>
get_epoch calls mktime_internal which isn't constexpr. For now, just
remove the constexpr from get_epoch.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
get_epoch calls mktime_internal which isn't constexpr. For now, just
remove the constexpr from get_epoch.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] create TimeReader to look at a struct tm (#126138)</title>
<updated>2025-02-11T22:37:15+00:00</updated>
<author>
<name>Michael Jones</name>
<email>michaelrj@google.com</email>
</author>
<published>2025-02-11T22:37:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a760e7faacb79e7ff0ae23d3ae370d1aa6e52666'/>
<id>a760e7faacb79e7ff0ae23d3ae370d1aa6e52666</id>
<content type='text'>
In the process of adding strftime (#122556) I wrote this utility class
to simplify reading from a struct tm. It provides helper functions that
return basically everything needed by strftime. It's not tested
directly, but it is thoroughly exercised by the strftime tests.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the process of adding strftime (#122556) I wrote this utility class
to simplify reading from a struct tm. It provides helper functions that
return basically everything needed by strftime. It's not tested
directly, but it is thoroughly exercised by the strftime tests.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][NFC] Cleanup time.h (#122027)</title>
<updated>2025-01-08T20:28:50+00:00</updated>
<author>
<name>Michael Jones</name>
<email>michaelrj@google.com</email>
</author>
<published>2025-01-08T20:28:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f9c2377fb68e5051b3061186c507f7b87db2a8b2'/>
<id>f9c2377fb68e5051b3061186c507f7b87db2a8b2</id>
<content type='text'>
While working on strftime I noticed some constants were being defined in
unexpected places. One thing led to another, and I ended up doing a
major cleanup of the time functions.

What's included:
All uses of &lt;time.h&gt; in /src and /test removed (except for LibcTest.cpp)
The various time constants have been moved to time_constants.h, and the
`time_constants` namespace.
struct tm gets its own type indirection header now.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While working on strftime I noticed some constants were being defined in
unexpected places. One thing led to another, and I ended up doing a
major cleanup of the time functions.

What's included:
All uses of &lt;time.h&gt; in /src and /test removed (except for LibcTest.cpp)
The various time constants have been moved to time_constants.h, and the
`time_constants` namespace.
struct tm gets its own type indirection header now.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][c11] implement ctime (#107285)</title>
<updated>2024-09-16T18:27:11+00:00</updated>
<author>
<name>Зишан Мирза</name>
<email>149377404+zimirza@users.noreply.github.com</email>
</author>
<published>2024-09-16T18:27:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=000a3f0a54876f1519393e40085500e16ea12cf4'/>
<id>000a3f0a54876f1519393e40085500e16ea12cf4</id>
<content type='text'>
This is an implementation of `ctime` and includes `ctime_r`.

According to documentation, `ctime` and `ctime_r` are defined as the
following:

```c
char *ctime(const time_t *timep);
char *ctime_r(const time_t *restrict timep, char buf[restrict 26]);
```

closes #86567</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is an implementation of `ctime` and includes `ctime_r`.

According to documentation, `ctime` and `ctime_r` are defined as the
following:

```c
char *ctime(const time_t *timep);
char *ctime_r(const time_t *restrict timep, char buf[restrict 26]);
```

closes #86567</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Allow time conversions to compile on bare metal (#102014)</title>
<updated>2024-08-07T08:11:31+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>simon.tatham@arm.com</email>
</author>
<published>2024-08-07T08:11:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=efd71d921396c71adb2362d91fd9cdfbac21abc2'/>
<id>efd71d921396c71adb2362d91fd9cdfbac21abc2</id>
<content type='text'>
The `&lt;time.h&gt;` functions `asctime`, `gmtime`, `mktime` and their `_r`
variants are purely computational functions which convert between well
defined time representations and/or strings. There's no reason these
shouldn't be available in bare-metal builds of the library as well as
hosted ones: even if the library has no way to find out the time in
POSIX format, it might still see POSIX-style `time_t` values in input
data (e.g. network protocols) and need to interpret them.

The only obstacle to this was that the `out_of_range()` helper function
set `errno` to `EOVERFLOW`, which fails in a bare-metal build because
the extra POSIX error values aren't defined, including `EOVERFLOW`. So
I've made that assignment conditional on `EOVERFLOW` being defined.

Fixes #85556.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `&lt;time.h&gt;` functions `asctime`, `gmtime`, `mktime` and their `_r`
variants are purely computational functions which convert between well
defined time representations and/or strings. There's no reason these
shouldn't be available in bare-metal builds of the library as well as
hosted ones: even if the library has no way to find out the time in
POSIX format, it might still see POSIX-style `time_t` values in input
data (e.g. network protocols) and need to interpret them.

The only obstacle to this was that the `out_of_range()` helper function
set `errno` to `EOVERFLOW`, which fails in a bare-metal build because
the extra POSIX error values aren't defined, including `EOVERFLOW`. So
I've made that assignment conditional on `EOVERFLOW` being defined.

Fixes #85556.</pre>
</div>
</content>
</entry>
</feed>
