[libc-commits] [libc] 31d797f - [libc][NFC] rename str_conv_utils to str_to_integer
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Wed Nov 3 15:56:34 PDT 2021
Author: Michael Jones
Date: 2021-11-03T15:56:28-07:00
New Revision: 31d797f41efe00dbc3eaf5d97778f1c4dd0c15c2
URL: https://github.com/llvm/llvm-project/commit/31d797f41efe00dbc3eaf5d97778f1c4dd0c15c2
DIFF: https://github.com/llvm/llvm-project/commit/31d797f41efe00dbc3eaf5d97778f1c4dd0c15c2.diff
LOG: [libc][NFC] rename str_conv_utils to str_to_integer
rename str_conv_utils to str_to_integer to be more
in line with str_to_float.
Reviewed By: sivachandra, lntue
Differential Revision: https://reviews.llvm.org/D113061
Added:
libc/src/__support/str_to_integer.h
Modified:
libc/src/__support/CMakeLists.txt
libc/src/__support/detailed_powers_of_ten.h
libc/src/__support/high_precision_decimal.h
libc/src/__support/str_to_float.h
libc/src/inttypes/CMakeLists.txt
libc/src/inttypes/strtoimax.cpp
libc/src/inttypes/strtoumax.cpp
libc/src/stdlib/CMakeLists.txt
libc/src/stdlib/atoi.cpp
libc/src/stdlib/atol.cpp
libc/src/stdlib/atoll.cpp
libc/src/stdlib/strtol.cpp
libc/src/stdlib/strtoll.cpp
libc/src/stdlib/strtoul.cpp
libc/src/stdlib/strtoull.cpp
libc/test/src/__support/CMakeLists.txt
Removed:
libc/src/__support/str_conv_utils.h
################################################################################
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index 5d2667dcb7fa4..567ed069b82c5 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -23,11 +23,22 @@ add_header_library(
)
add_header_library(
- str_conv_utils
+ str_to_integer
+ HDRS
+ str_to_integer.h
+ DEPENDS
+ .ctype_utils
+ libc.include.errno
+ libc.src.errno.__errno_location
+ libc.src.__support.CPP.standalone_cpp
+)
+
+add_header_library(
+ str_to_float
HDRS
- str_conv_utils.h
str_to_float.h
DEPENDS
+ .str_to_integer
.ctype_utils
.high_precision_decimal
libc.include.errno
diff --git a/libc/src/__support/detailed_powers_of_ten.h b/libc/src/__support/detailed_powers_of_ten.h
index e168b95b8998e..9a58ba5dff782 100644
--- a/libc/src/__support/detailed_powers_of_ten.h
+++ b/libc/src/__support/detailed_powers_of_ten.h
@@ -21,7 +21,7 @@ namespace internal {
// and contains the 128 bit mantissa approximations of the powers of 10 from
// -348 to 347. The exponents are implied by a linear expression with slope
// 217706.0/65536.0 ≈ log(10)/log(2). This is used by the Eisel-Lemire algorithm
-// in str_conv_utils.h.
+// in str_to_float.h.
constexpr int32_t DETAILED_POWERS_OF_TEN_MIN_EXP_10 = -348;
constexpr int32_t DETAILED_POWERS_OF_TEN_MAX_EXP_10 = 347;
diff --git a/libc/src/__support/high_precision_decimal.h b/libc/src/__support/high_precision_decimal.h
index ae8aac37605ad..352de581a8f72 100644
--- a/libc/src/__support/high_precision_decimal.h
+++ b/libc/src/__support/high_precision_decimal.h
@@ -10,7 +10,7 @@
#define LIBC_SRC_SUPPORT_HIGH_PRECISION_DECIMAL_H
#include "src/__support/ctype_utils.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
#include <stdint.h>
namespace __llvm_libc {
diff --git a/libc/src/__support/str_to_float.h b/libc/src/__support/str_to_float.h
index b62e8ff4c4dc3..59bd1ec8e5da4 100644
--- a/libc/src/__support/str_to_float.h
+++ b/libc/src/__support/str_to_float.h
@@ -14,7 +14,7 @@
#include "src/__support/ctype_utils.h"
#include "src/__support/detailed_powers_of_ten.h"
#include "src/__support/high_precision_decimal.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
#include <errno.h>
namespace __llvm_libc {
diff --git a/libc/src/__support/str_conv_utils.h b/libc/src/__support/str_to_integer.h
similarity index 96%
rename from libc/src/__support/str_conv_utils.h
rename to libc/src/__support/str_to_integer.h
index 13c800aac6578..ec7f6f54a88f1 100644
--- a/libc/src/__support/str_conv_utils.h
+++ b/libc/src/__support/str_to_integer.h
@@ -1,4 +1,4 @@
-//===-- Stdlib utils --------------------------------------------*- C++ -*-===//
+//===-- String to integer conversion utils ----------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STDLIB_STDLIB_UTILS_H
-#define LIBC_SRC_STDLIB_STDLIB_UTILS_H
+#ifndef LIBC_SRC_SUPPORT_STR_TO_INTEGER_H
+#define LIBC_SRC_SUPPORT_STR_TO_INTEGER_H
#include "src/__support/CPP/Limits.h"
#include "src/__support/ctype_utils.h"
@@ -148,4 +148,4 @@ static inline T strtointeger(const char *__restrict src,
} // namespace internal
} // namespace __llvm_libc
-#endif // LIBC_SRC_STDLIB_STDLIB_UTILS_H
+#endif // LIBC_SRC_SUPPORT_STR_TO_INTEGER_H
diff --git a/libc/src/inttypes/CMakeLists.txt b/libc/src/inttypes/CMakeLists.txt
index e0e0f4d57f2b9..00fd791320fb2 100644
--- a/libc/src/inttypes/CMakeLists.txt
+++ b/libc/src/inttypes/CMakeLists.txt
@@ -5,7 +5,7 @@ add_entrypoint_object(
HDRS
strtoimax.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_integer
)
add_entrypoint_object(
@@ -15,7 +15,7 @@ add_entrypoint_object(
HDRS
strtoumax.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_integer
)
add_entrypoint_object(
diff --git a/libc/src/inttypes/strtoimax.cpp b/libc/src/inttypes/strtoimax.cpp
index ecd59ff717383..ef5e84e2034a7 100644
--- a/libc/src/inttypes/strtoimax.cpp
+++ b/libc/src/inttypes/strtoimax.cpp
@@ -8,7 +8,7 @@
#include "src/inttypes/strtoimax.h"
#include "src/__support/common.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
namespace __llvm_libc {
diff --git a/libc/src/inttypes/strtoumax.cpp b/libc/src/inttypes/strtoumax.cpp
index cc3f1451fdae3..edf8b65f161a2 100644
--- a/libc/src/inttypes/strtoumax.cpp
+++ b/libc/src/inttypes/strtoumax.cpp
@@ -8,7 +8,7 @@
#include "src/inttypes/strtoumax.h"
#include "src/__support/common.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
namespace __llvm_libc {
diff --git a/libc/src/stdlib/CMakeLists.txt b/libc/src/stdlib/CMakeLists.txt
index 3700d9a240952..f5f339080e82f 100644
--- a/libc/src/stdlib/CMakeLists.txt
+++ b/libc/src/stdlib/CMakeLists.txt
@@ -5,7 +5,7 @@ add_entrypoint_object(
HDRS
atoi.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_integer
)
add_entrypoint_object(
@@ -15,7 +15,7 @@ add_entrypoint_object(
HDRS
atof.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_float
)
add_entrypoint_object(
@@ -25,7 +25,7 @@ add_entrypoint_object(
HDRS
atol.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_integer
)
add_entrypoint_object(
@@ -35,7 +35,7 @@ add_entrypoint_object(
HDRS
atoll.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_integer
)
add_entrypoint_object(
@@ -45,7 +45,7 @@ add_entrypoint_object(
HDRS
strtof.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_float
)
add_entrypoint_object(
@@ -55,7 +55,7 @@ add_entrypoint_object(
HDRS
strtod.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_float
)
add_entrypoint_object(
@@ -65,7 +65,7 @@ add_entrypoint_object(
HDRS
strtol.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_integer
)
add_entrypoint_object(
@@ -75,7 +75,7 @@ add_entrypoint_object(
HDRS
strtoll.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_integer
)
add_entrypoint_object(
@@ -85,7 +85,7 @@ add_entrypoint_object(
HDRS
strtoul.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_integer
)
add_entrypoint_object(
@@ -95,7 +95,7 @@ add_entrypoint_object(
HDRS
strtoull.h
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_integer
)
add_entrypoint_object(
diff --git a/libc/src/stdlib/atoi.cpp b/libc/src/stdlib/atoi.cpp
index f0e57caf743d5..37cfab14443c0 100644
--- a/libc/src/stdlib/atoi.cpp
+++ b/libc/src/stdlib/atoi.cpp
@@ -8,7 +8,7 @@
#include "src/stdlib/atoi.h"
#include "src/__support/common.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
namespace __llvm_libc {
diff --git a/libc/src/stdlib/atol.cpp b/libc/src/stdlib/atol.cpp
index 8f0ed885a9c97..6a1da4c7007d9 100644
--- a/libc/src/stdlib/atol.cpp
+++ b/libc/src/stdlib/atol.cpp
@@ -8,7 +8,7 @@
#include "src/stdlib/atol.h"
#include "src/__support/common.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
namespace __llvm_libc {
diff --git a/libc/src/stdlib/atoll.cpp b/libc/src/stdlib/atoll.cpp
index c75e521382190..ffa8105d4cc6f 100644
--- a/libc/src/stdlib/atoll.cpp
+++ b/libc/src/stdlib/atoll.cpp
@@ -8,7 +8,7 @@
#include "src/stdlib/atoll.h"
#include "src/__support/common.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
namespace __llvm_libc {
diff --git a/libc/src/stdlib/strtol.cpp b/libc/src/stdlib/strtol.cpp
index 1c744c929e283..33038b51c41ee 100644
--- a/libc/src/stdlib/strtol.cpp
+++ b/libc/src/stdlib/strtol.cpp
@@ -8,7 +8,7 @@
#include "src/stdlib/strtol.h"
#include "src/__support/common.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
namespace __llvm_libc {
diff --git a/libc/src/stdlib/strtoll.cpp b/libc/src/stdlib/strtoll.cpp
index e2fc37f8bf822..e2f0aac546688 100644
--- a/libc/src/stdlib/strtoll.cpp
+++ b/libc/src/stdlib/strtoll.cpp
@@ -8,7 +8,7 @@
#include "src/stdlib/strtoll.h"
#include "src/__support/common.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
namespace __llvm_libc {
diff --git a/libc/src/stdlib/strtoul.cpp b/libc/src/stdlib/strtoul.cpp
index eab264f33347f..00696799872c4 100644
--- a/libc/src/stdlib/strtoul.cpp
+++ b/libc/src/stdlib/strtoul.cpp
@@ -8,7 +8,7 @@
#include "src/stdlib/strtoul.h"
#include "src/__support/common.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
namespace __llvm_libc {
diff --git a/libc/src/stdlib/strtoull.cpp b/libc/src/stdlib/strtoull.cpp
index bece2787ba7ea..db6c83872b55e 100644
--- a/libc/src/stdlib/strtoull.cpp
+++ b/libc/src/stdlib/strtoull.cpp
@@ -8,7 +8,7 @@
#include "src/stdlib/strtoull.h"
#include "src/__support/common.h"
-#include "src/__support/str_conv_utils.h"
+#include "src/__support/str_to_integer.h"
namespace __llvm_libc {
diff --git a/libc/test/src/__support/CMakeLists.txt b/libc/test/src/__support/CMakeLists.txt
index 85b819c23ab60..d2367ef52f692 100644
--- a/libc/test/src/__support/CMakeLists.txt
+++ b/libc/test/src/__support/CMakeLists.txt
@@ -27,7 +27,7 @@ add_libc_unittest(
SRCS
str_to_float_test.cpp
DEPENDS
- libc.src.__support.str_conv_utils
+ libc.src.__support.str_to_float
)
add_executable(
More information about the libc-commits
mailing list