| Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
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.
|
|
This is a (no-op) locale version of strftime.
Fixes: https://github.com/llvm/llvm-project/issues/106630
|
|
Reverts llvm/llvm-project#127708
|
|
This is a (no-op) locale version of strftime.
|