SSiva Chandra Reddy[libc] Make the errno macro resolve to the thread local variable directly.
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[libc] Make the errno macro resolve to the thread local variable directly. With modern architectures having a thread pointer and language supporting thread locals, there is no reason to use a function intermediary to access the thread local errno value. The entrypoint corresponding to errno has been replaced with an object library as there is no formal entrypoint for errno anymore. Reviewed By: jeffbailey, michaelrj Differential Revision: https://reviews.llvm.org/D120920 | 4 年前 | |
[libc] apply new lint rules This patch applies the lint rules described in the previous patch. There was also a significant amount of effort put into manually fixing things, since all of the templated functions, or structs defined in /spec, were not updated and had to be handled manually. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D114302 | 4 年前 | |
[libc] Introduce asctime, asctime_r to LLVM libc [libc] Introduce asctime, asctime_r to LLVM libc asctime and asctime_r share the same common code. They call asctime_internal a static inline function. asctime uses snprintf to return the string representation in a buffer. It uses the following format (26 characters is the buffer size) as per 7.27.3.1 section in http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2478.pdf. The buf parameter for asctime_r shall point to a buffer of at least 26 bytes. snprintf(buf, 26, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",...) Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D99686 | 5 年前 | |
[libc] apply new lint rules This patch applies the lint rules described in the previous patch. There was also a significant amount of effort put into manually fixing things, since all of the templated functions, or structs defined in /spec, were not updated and had to be handled manually. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D114302 | 4 年前 | |
[libc] Introduce asctime, asctime_r to LLVM libc [libc] Introduce asctime, asctime_r to LLVM libc asctime and asctime_r share the same common code. They call asctime_internal a static inline function. asctime uses snprintf to return the string representation in a buffer. It uses the following format (26 characters is the buffer size) as per 7.27.3.1 section in http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2478.pdf. The buf parameter for asctime_r shall point to a buffer of at least 26 bytes. snprintf(buf, 26, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",...) Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D99686 | 5 年前 | |
[libc] Introduces gmtime_r to LLVM libc, based on C99/C2X/Single Unix Sp. gmtime and gmtime_r share the same common code. They call gmtime_internal a static inline function. Thus added only validation tests for gmtime_r. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D99046 | 5 年前 | |
This introduces gmtime to LLVM libc, based on C99/C2X/Single Unix Spec. This change doesn't handle TIMEZONE, tm_isdst and leap seconds. Moved shared code between mktime and gmtime into time_utils.cpp. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D98467 | 5 年前 | |
[libc] Introduces gmtime_r to LLVM libc, based on C99/C2X/Single Unix Sp. gmtime and gmtime_r share the same common code. They call gmtime_internal a static inline function. Thus added only validation tests for gmtime_r. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D99046 | 5 年前 | |
[libc] Introduces gmtime_r to LLVM libc, based on C99/C2X/Single Unix Sp. gmtime and gmtime_r share the same common code. They call gmtime_internal a static inline function. Thus added only validation tests for gmtime_r. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D99046 | 5 年前 | |
[libc] apply new lint rules This patch applies the lint rules described in the previous patch. There was also a significant amount of effort put into manually fixing things, since all of the templated functions, or structs defined in /spec, were not updated and had to be handled manually. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D114302 | 4 年前 | |
Initial commit of mktime. This introduces mktime to LLVM libc, based on C99/C2X/Single Unix Spec. Co-authored-by: Jeff Bailey <jeffbailey@google.com> This change doesn't handle TIMEZONE, tm_isdst and leap seconds. It returns -1 for invalid dates. I have verified the return results for all the possible dates with glibc's mktime. TODO: + Handle leap seconds. + Handle out of range time and date values that don't overflow or underflow. + Implement the following suggestion Siva - As we start accumulating the seconds, we should be able to check if the next amount of seconds to be added can lead to an overflow. If it does, return the overflow value. If not keep accumulating. The benefit is that, we don't have to validate every input, and also do not need the special cases for sizeof(time_t) == 4. + Handle timezone and update of tm_isdst Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D91551 | 5 年前 | |
[libc] apply new lint rules This patch applies the lint rules described in the previous patch. There was also a significant amount of effort put into manually fixing things, since all of the templated functions, or structs defined in /spec, were not updated and had to be handled manually. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D114302 | 4 年前 | |
[libc] apply new lint rules This patch applies the lint rules described in the previous patch. There was also a significant amount of effort put into manually fixing things, since all of the templated functions, or structs defined in /spec, were not updated and had to be handled manually. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D114302 | 4 年前 |