<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/time/strftime.cpp, branch main</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] Refactor strftime internals to handle size_t return values (#166901)</title>
<updated>2025-11-11T17:54:09+00:00</updated>
<author>
<name>Marcell Leleszi</name>
<email>59964679+mleleszi@users.noreply.github.com</email>
</author>
<published>2025-11-11T17:54:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a4a6b5ff63ecdea5512d47e192abd1ed81390478'/>
<id>a4a6b5ff63ecdea5512d47e192abd1ed81390478</id>
<content type='text'>
Now that https://github.com/llvm/llvm-project/pull/166517 has landed and
[Writer](https://github.com/llvm/llvm-project/blob/main/libc/src/stdio/printf_core/writer.h#L130)
has been refactored to track bytes written as size_t, strftime can be
refactored as well to handle size_t return values.

Can't think of a proper way to test this without creating a 2GB+ string,
but existing tests cover most cases.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that https://github.com/llvm/llvm-project/pull/166517 has landed and
[Writer](https://github.com/llvm/llvm-project/blob/main/libc/src/stdio/printf_core/writer.h#L130)
has been refactored to track bytes written as size_t, strftime can be
refactored as well to handle size_t return values.

Can't think of a proper way to test this without creating a 2GB+ string,
but existing tests cover most cases.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix off by one error in strftime (#165711)</title>
<updated>2025-10-30T17:35:42+00:00</updated>
<author>
<name>Marcell Leleszi</name>
<email>59964679+mleleszi@users.noreply.github.com</email>
</author>
<published>2025-10-30T17:35:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=784b74c6ef8a7f6ffaa7ab250eb35696dd833426'/>
<id>784b74c6ef8a7f6ffaa7ab250eb35696dd833426</id>
<content type='text'>
This patch fixes a bug in strftime's return value when the formatted
output exactly fills the buffer, not including the null terminator. The
previous check failed to account for the null terminator in this case,
incorrectly returning the written count instead of 0.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes a bug in strftime's return value when the formatted
output exactly fills the buffer, not including the null terminator. The
previous check failed to account for the null terminator in this case,
incorrectly returning the written count instead of 0.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Template the writing mode for the writer class (#111559)</title>
<updated>2025-03-12T18:51:44+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-03-12T18:51:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=598e882ee88a1e3349fb6d8dcd68f6d3b1c6334f'/>
<id>598e882ee88a1e3349fb6d8dcd68f6d3b1c6334f</id>
<content type='text'>
Summary:
Currently we dispatch the writing mode off of a runtime enum passed in
by the constructor. This causes very unfortunate codegen for the GPU
targets where we get worst-case codegen because of the unused function
pointer for `sprintf`. Instead, this patch moves all of this to a
template so it can be masked out. This results in no dynamic stack and
uses 60 VGPRs instead of 117. It also compiles about 5x as fast.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Currently we dispatch the writing mode off of a runtime enum passed in
by the constructor. This causes very unfortunate codegen for the GPU
targets where we get worst-case codegen because of the unused function
pointer for `sprintf`. Instead, this patch moves all of this to a
template so it can be masked out. This results in no dynamic stack and
uses 60 VGPRs instead of 117. It also compiles about 5x as fast.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add strftime_l (#127767)</title>
<updated>2025-02-21T18:50:32+00:00</updated>
<author>
<name>Petr Hosek</name>
<email>phosek@google.com</email>
</author>
<published>2025-02-21T18:50:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=00637b7dfb15b6e4f94a29ac8ab9226d1e9c0788'/>
<id>00637b7dfb15b6e4f94a29ac8ab9226d1e9c0788</id>
<content type='text'>
This is a (no-op) locale version of strftime.

Fixes: https://github.com/llvm/llvm-project/issues/106630</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a (no-op) locale version of strftime.

Fixes: https://github.com/llvm/llvm-project/issues/106630</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[libc] Add strftime_l" (#127766)</title>
<updated>2025-02-19T08:39:33+00:00</updated>
<author>
<name>Petr Hosek</name>
<email>phosek@google.com</email>
</author>
<published>2025-02-19T08:39:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a2b4d4e756ff2710e15a6378e337fb5888e5ac36'/>
<id>a2b4d4e756ff2710e15a6378e337fb5888e5ac36</id>
<content type='text'>
Reverts llvm/llvm-project#127708</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#127708</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add strftime_l (#127708)</title>
<updated>2025-02-19T07:54:45+00:00</updated>
<author>
<name>Petr Hosek</name>
<email>phosek@google.com</email>
</author>
<published>2025-02-19T07:54:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9072ba71cac6d518b4164615c609e358d49c4ed2'/>
<id>9072ba71cac6d518b4164615c609e358d49c4ed2</id>
<content type='text'>
This is a (no-op) locale version of strftime.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a (no-op) locale version of strftime.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Implement strftime (#122556)</title>
<updated>2025-02-14T23:56:55+00:00</updated>
<author>
<name>Michael Jones</name>
<email>michaelrj@google.com</email>
</author>
<published>2025-02-14T23:56:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=398f865499e6d7c35df2496cdff29ed0239423de'/>
<id>398f865499e6d7c35df2496cdff29ed0239423de</id>
<content type='text'>
Implements the posix-specified strftime conversions for the default
locale, along with comprehensive unit tests. This reuses a lot of design
from printf, as well as the printf writer.

Roughly based on #111305, but with major rewrites.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implements the posix-specified strftime conversions for the default
locale, along with comprehensive unit tests. This reuses a lot of design
from printf, as well as the printf writer.

Roughly based on #111305, but with major rewrites.</pre>
</div>
</content>
</entry>
</feed>
