[libc] Add strtol, strtoul, and strtoull
authorMichael Jones <michaelrj@google.com>
Thu, 12 Aug 2021 21:34:02 +0000 (21:34 +0000)
committerMichael Jones <michaelrj@google.com>
Tue, 17 Aug 2021 21:05:37 +0000 (21:05 +0000)
commitd52f0aeca5dbde61aadbcd20e1b8cfaf15a84a65
treed41d95c0c546d8f0a300e7ba0cb8dafcf4ce606f
parent359cfa2af79e3fbf42accfdde42ccae123113560
[libc] Add strtol, strtoul, and strtoull

Updates the internal string conversion function so that it
uses the new Limits.h added in a previous commit for max and min values,
and has a templated type. This makes implementing the other strto*
functions very simple.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D107999
18 files changed:
libc/config/linux/x86_64/entrypoints.txt
libc/spec/spec.td
libc/spec/stdc.td
libc/src/__support/CMakeLists.txt
libc/src/__support/str_conv_utils.h
libc/src/stdlib/CMakeLists.txt
libc/src/stdlib/strtol.cpp [new file with mode: 0644]
libc/src/stdlib/strtol.h [new file with mode: 0644]
libc/src/stdlib/strtoll.cpp
libc/src/stdlib/strtoul.cpp [new file with mode: 0644]
libc/src/stdlib/strtoul.h [new file with mode: 0644]
libc/src/stdlib/strtoull.cpp [new file with mode: 0644]
libc/src/stdlib/strtoull.h [new file with mode: 0644]
libc/test/src/stdlib/CMakeLists.txt
libc/test/src/stdlib/strtol_test.cpp [new file with mode: 0644]
libc/test/src/stdlib/strtoll_test.cpp
libc/test/src/stdlib/strtoul_test.cpp [new file with mode: 0644]
libc/test/src/stdlib/strtoull_test.cpp [new file with mode: 0644]