[libc-commits] [libc] [llvm] [libc] Migrate printf_core libc/src/stdio/ to libc/src/__support. (PR #208303)
via libc-commits
libc-commits at lists.llvm.org
Wed Jul 8 12:58:10 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Alex Strelnikov (strel-12)
<details>
<summary>Changes</summary>
The code will be updated and used for wide character printf functions implemented in wchar/, so __support/ is a more consistent shared location.
Assisted-by: Automated tooling, human reviewed.
---
Patch is 95.25 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/208303.diff
80 Files Affected:
- (modified) libc/fuzzing/stdio/CMakeLists.txt (+1-1)
- (modified) libc/fuzzing/stdio/printf_parser_fuzz.cpp (+1-1)
- (modified) libc/src/__support/CMakeLists.txt (+2)
- (renamed) libc/src/__support/printf_core/CMakeLists.txt (+6-6)
- (renamed) libc/src/__support/printf_core/char_converter.h (+6-6)
- (renamed) libc/src/__support/printf_core/converter.h (+9-9)
- (renamed) libc/src/__support/printf_core/converter_atlas.h (+13-13)
- (renamed) libc/src/__support/printf_core/converter_utils.h (+4-4)
- (renamed) libc/src/__support/printf_core/core_structs.h (+4-4)
- (renamed) libc/src/__support/printf_core/error_mapper.h (+3-3)
- (renamed) libc/src/__support/printf_core/fixed_converter.h (+6-6)
- (renamed) libc/src/__support/printf_core/float_dec_converter.h (+7-7)
- (renamed) libc/src/__support/printf_core/float_dec_converter_limited.h (+6-6)
- (renamed) libc/src/__support/printf_core/float_hex_converter.h (+7-7)
- (renamed) libc/src/__support/printf_core/float_impl.cpp (+1-1)
- (renamed) libc/src/__support/printf_core/float_inf_nan_converter.h (+6-6)
- (renamed) libc/src/__support/printf_core/generic/CMakeLists.txt (+1-1)
- (renamed) libc/src/__support/printf_core/generic/error_mapper.h (+5-5)
- (renamed) libc/src/__support/printf_core/int_converter.h (+6-6)
- (renamed) libc/src/__support/printf_core/linux/CMakeLists.txt (+1-1)
- (renamed) libc/src/__support/printf_core/linux/error_mapper.h (+5-5)
- (renamed) libc/src/__support/printf_core/parser.h (+5-5)
- (renamed) libc/src/__support/printf_core/printf_config.h (+3-3)
- (renamed) libc/src/__support/printf_core/printf_main.h (+7-7)
- (renamed) libc/src/__support/printf_core/ptr_converter.h (+7-7)
- (renamed) libc/src/__support/printf_core/strerror_converter.h (+7-7)
- (renamed) libc/src/__support/printf_core/string_converter.h (+6-6)
- (renamed) libc/src/__support/printf_core/vasprintf_internal.h (+8-3)
- (renamed) libc/src/__support/printf_core/vfprintf_internal.h (+6-6)
- (renamed) libc/src/__support/printf_core/write_int_converter.h (+5-5)
- (renamed) libc/src/__support/printf_core/write_modes.def ()
- (renamed) libc/src/__support/printf_core/writer.h (+5-5)
- (modified) libc/src/stdio/CMakeLists.txt (+22-23)
- (modified) libc/src/stdio/asprintf.cpp (+3-3)
- (modified) libc/src/stdio/asprintf_modular.cpp (+3-3)
- (modified) libc/src/stdio/baremetal/CMakeLists.txt (+4-4)
- (modified) libc/src/stdio/baremetal/vfprintf_internal.h (+4-4)
- (modified) libc/src/stdio/generic/CMakeLists.txt (+3-3)
- (modified) libc/src/stdio/generic/fprintf.cpp (+3-3)
- (modified) libc/src/stdio/generic/printf.cpp (+3-3)
- (modified) libc/src/stdio/generic/vfprintf.cpp (+3-3)
- (modified) libc/src/stdio/generic/vprintf.cpp (+3-3)
- (modified) libc/src/stdio/snprintf.cpp (+4-4)
- (modified) libc/src/stdio/snprintf_modular.cpp (+4-4)
- (modified) libc/src/stdio/sprintf.cpp (+4-4)
- (modified) libc/src/stdio/sprintf_modular.cpp (+4-4)
- (modified) libc/src/stdio/vasprintf.cpp (+3-3)
- (modified) libc/src/stdio/vasprintf_modular.cpp (+3-3)
- (modified) libc/src/stdio/vsnprintf.cpp (+4-4)
- (modified) libc/src/stdio/vsnprintf_modular.cpp (+4-4)
- (modified) libc/src/stdio/vsprintf.cpp (+4-4)
- (modified) libc/src/stdio/vsprintf_modular.cpp (+4-4)
- (modified) libc/src/stdlib/CMakeLists.txt (+6-6)
- (modified) libc/src/stdlib/str_from_util.h (+3-3)
- (modified) libc/src/stdlib/strfromd.cpp (+2-2)
- (modified) libc/src/stdlib/strfromf.cpp (+2-2)
- (modified) libc/src/stdlib/strfroml.cpp (+2-2)
- (modified) libc/src/time/CMakeLists.txt (+2-2)
- (modified) libc/src/time/strftime.cpp (+1-1)
- (modified) libc/src/time/strftime_core/CMakeLists.txt (+2-2)
- (modified) libc/src/time/strftime_core/composite_converter.h (+1-1)
- (modified) libc/src/time/strftime_core/converter.h (+1-1)
- (modified) libc/src/time/strftime_core/num_converter.h (+1-1)
- (modified) libc/src/time/strftime_core/str_converter.h (+1-1)
- (modified) libc/src/time/strftime_core/strftime_main.h (+1-1)
- (modified) libc/src/time/strftime_l.cpp (+1-1)
- (modified) libc/test/UnitTest/CMakeLists.txt (+2-2)
- (modified) libc/test/UnitTest/PrintfMatcher.cpp (+2-2)
- (modified) libc/test/UnitTest/PrintfMatcher.h (+1-1)
- (modified) libc/test/shared/CMakeLists.txt (+3-3)
- (modified) libc/test/src/__support/CMakeLists.txt (+1)
- (renamed) libc/test/src/__support/printf_core/CMakeLists.txt (+9-9)
- (renamed) libc/test/src/__support/printf_core/converter_test.cpp (+3-3)
- (renamed) libc/test/src/__support/printf_core/parser_test.cpp (+1-1)
- (renamed) libc/test/src/__support/printf_core/writer_test.cpp (+1-1)
- (modified) libc/test/src/stdio/CMakeLists.txt (+1-2)
- (modified) libc/test/src/stdio/sprintf_test.cpp (+1-1)
- (modified) utils/bazel/llvm-project-overlay/libc/BUILD.bazel (+218-218)
- (modified) utils/bazel/llvm-project-overlay/libc/test/src/__support/BUILD.bazel (+37)
- (modified) utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel (-37)
``````````diff
diff --git a/libc/fuzzing/stdio/CMakeLists.txt b/libc/fuzzing/stdio/CMakeLists.txt
index 401785a30469c..86f095e84737e 100644
--- a/libc/fuzzing/stdio/CMakeLists.txt
+++ b/libc/fuzzing/stdio/CMakeLists.txt
@@ -3,7 +3,7 @@ add_libc_fuzzer(
SRCS
printf_parser_fuzz.cpp
DEPENDS
- libc.src.stdio.printf_core.parser
+ libc.src.__support.printf_core.parser
libc.src.errno.errno # needed for the strerror conversion
)
diff --git a/libc/fuzzing/stdio/printf_parser_fuzz.cpp b/libc/fuzzing/stdio/printf_parser_fuzz.cpp
index e745850bd6c3a..71da37d470fa8 100644
--- a/libc/fuzzing/stdio/printf_parser_fuzz.cpp
+++ b/libc/fuzzing/stdio/printf_parser_fuzz.cpp
@@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//
#include "src/__support/arg_list.h"
-#include "src/stdio/printf_core/parser.h"
+#include "src/__support/printf_core/parser.h"
#include <stdarg.h>
#include <stdint.h>
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index f4cb283976bc3..12761e6a524b9 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -462,6 +462,8 @@ add_subdirectory(threads)
add_subdirectory(File)
+add_subdirectory(printf_core)
+
add_subdirectory(HashTable)
add_subdirectory(fixed_point)
diff --git a/libc/src/stdio/printf_core/CMakeLists.txt b/libc/src/__support/printf_core/CMakeLists.txt
similarity index 93%
rename from libc/src/stdio/printf_core/CMakeLists.txt
rename to libc/src/__support/printf_core/CMakeLists.txt
index 4d6f25a2ddd00..e85841f806e10 100644
--- a/libc/src/stdio/printf_core/CMakeLists.txt
+++ b/libc/src/__support/printf_core/CMakeLists.txt
@@ -41,9 +41,9 @@ else()
add_subdirectory(generic)
endif()
-set(target_error_mapper libc.src.stdio.printf_core.${LIBC_TARGET_OS}.error_mapper)
+set(target_error_mapper libc.src.__support.printf_core.${LIBC_TARGET_OS}.error_mapper)
if(NOT TARGET ${target_error_mapper})
- set(target_error_mapper libc.src.stdio.printf_core.generic.error_mapper)
+ set(target_error_mapper libc.src.__support.printf_core.generic.error_mapper)
endif()
if(LIBC_CONF_PRINTF_DISABLE_WIDE)
@@ -178,8 +178,8 @@ add_header_library(
libc.hdr.func.realloc
libc.src.__support.arg_list
libc.src.__support.error_or
- libc.src.stdio.printf_core.printf_main
- libc.src.stdio.printf_core.writer
+ libc.src.__support.printf_core.printf_main
+ libc.src.__support.printf_core.writer
)
add_header_library(
@@ -205,8 +205,8 @@ add_header_library(
libc.src.__support.File.file
libc.src.__support.error_or
libc.src.__support.arg_list
- libc.src.stdio.printf_core.printf_main
- libc.src.stdio.printf_core.writer
+ libc.src.__support.printf_core.printf_main
+ libc.src.__support.printf_core.writer
${use_system_file}
)
diff --git a/libc/src/stdio/printf_core/char_converter.h b/libc/src/__support/printf_core/char_converter.h
similarity index 87%
rename from libc/src/stdio/printf_core/char_converter.h
rename to libc/src/__support/printf_core/char_converter.h
index e4792c3b23b9f..59f3e22f7ce50 100644
--- a/libc/src/stdio/printf_core/char_converter.h
+++ b/libc/src/__support/printf_core/char_converter.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CHAR_CONVERTER_H
-#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CHAR_CONVERTER_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CHAR_CONVERTER_H
+#define LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CHAR_CONVERTER_H
#ifndef LIBC_COPT_PRINTF_DISABLE_WIDE
#include "hdr/types/wchar_t.h"
@@ -19,9 +19,9 @@
#include "hdr/limits_macros.h"
#include "src/__support/macros/config.h"
-#include "src/stdio/printf_core/converter_utils.h"
-#include "src/stdio/printf_core/core_structs.h"
-#include "src/stdio/printf_core/writer.h"
+#include "src/__support/printf_core/converter_utils.h"
+#include "src/__support/printf_core/core_structs.h"
+#include "src/__support/printf_core/writer.h"
namespace LIBC_NAMESPACE_DECL {
namespace printf_core {
@@ -85,4 +85,4 @@ LIBC_INLINE int convert_char(Writer<write_mode> *writer,
} // namespace printf_core
} // namespace LIBC_NAMESPACE_DECL
-#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CHAR_CONVERTER_H
+#endif // LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CHAR_CONVERTER_H
diff --git a/libc/src/stdio/printf_core/converter.h b/libc/src/__support/printf_core/converter.h
similarity index 89%
rename from libc/src/stdio/printf_core/converter.h
rename to libc/src/__support/printf_core/converter.h
index e931d6c34db68..67d0ee3d42b61 100644
--- a/libc/src/stdio/printf_core/converter.h
+++ b/libc/src/__support/printf_core/converter.h
@@ -6,19 +6,19 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_H
-#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CONVERTER_H
+#define LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CONVERTER_H
#include "src/__support/macros/config.h"
-#include "src/stdio/printf_core/core_structs.h"
-#include "src/stdio/printf_core/printf_config.h"
-#include "src/stdio/printf_core/strerror_converter.h"
-#include "src/stdio/printf_core/writer.h"
+#include "src/__support/printf_core/core_structs.h"
+#include "src/__support/printf_core/printf_config.h"
+#include "src/__support/printf_core/strerror_converter.h"
+#include "src/__support/printf_core/writer.h"
// This option allows for replacing all of the conversion functions with custom
// replacements. This allows conversions to be replaced at compile time.
#ifndef LIBC_COPT_PRINTF_CONV_ATLAS
-#include "src/stdio/printf_core/converter_atlas.h"
+#include "src/__support/printf_core/converter_atlas.h"
#else
#include LIBC_COPT_PRINTF_CONV_ATLAS
#endif
@@ -55,7 +55,7 @@ LIBC_PRINTF_MODULE((template <WriteMode write_mode>
#define HANDLE_WRITE_MODE(MODE) \
template int convert_float<WriteMode::MODE>( \
Writer<WriteMode::MODE> * writer, const FormatSection &to_conv);
-#include "src/stdio/printf_core/write_modes.def"
+#include "src/__support/printf_core/write_modes.def"
#undef HANDLE_WRITE_MODE
#endif // LIBC_PRINTF_DEFINE_MODULES
@@ -137,4 +137,4 @@ int convert(Writer<write_mode> *writer, const FormatSection &to_conv) {
} // namespace printf_core
} // namespace LIBC_NAMESPACE_DECL
-#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_H
+#endif // LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CONVERTER_H
diff --git a/libc/src/stdio/printf_core/converter_atlas.h b/libc/src/__support/printf_core/converter_atlas.h
similarity index 62%
rename from libc/src/stdio/printf_core/converter_atlas.h
rename to libc/src/__support/printf_core/converter_atlas.h
index dfb91b30e80f8..e60df06cbac05 100644
--- a/libc/src/stdio/printf_core/converter_atlas.h
+++ b/libc/src/__support/printf_core/converter_atlas.h
@@ -10,46 +10,46 @@
// just replace the #include, additionally it keeps the ifdefs out of the
// converter header.
-#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_ATLAS_H
-#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_ATLAS_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CONVERTER_ATLAS_H
+#define LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CONVERTER_ATLAS_H
// defines convert_string
-#include "src/stdio/printf_core/string_converter.h"
+#include "src/__support/printf_core/string_converter.h"
// defines convert_char
-#include "src/stdio/printf_core/char_converter.h"
+#include "src/__support/printf_core/char_converter.h"
// defines convert_int
-#include "src/stdio/printf_core/int_converter.h"
+#include "src/__support/printf_core/int_converter.h"
#ifndef LIBC_COPT_PRINTF_DISABLE_FLOAT
// defines convert_float_decimal
// defines convert_float_dec_exp
// defines convert_float_dec_auto
#ifdef LIBC_COPT_FLOAT_TO_STR_USE_FLOAT320
-#include "src/stdio/printf_core/float_dec_converter_limited.h"
+#include "src/__support/printf_core/float_dec_converter_limited.h"
#else
-#include "src/stdio/printf_core/float_dec_converter.h"
+#include "src/__support/printf_core/float_dec_converter.h"
#endif
// defines convert_float_hex_exp
-#include "src/stdio/printf_core/float_hex_converter.h"
+#include "src/__support/printf_core/float_hex_converter.h"
#endif // LIBC_COPT_PRINTF_DISABLE_FLOAT
#ifdef LIBC_INTERNAL_PRINTF_HAS_FIXED_POINT
// defines convert_fixed
-#include "src/stdio/printf_core/fixed_converter.h"
+#include "src/__support/printf_core/fixed_converter.h"
#endif // LIBC_INTERNAL_PRINTF_HAS_FIXED_POINT
#ifndef LIBC_COPT_PRINTF_DISABLE_WRITE_INT
-#include "src/stdio/printf_core/write_int_converter.h"
+#include "src/__support/printf_core/write_int_converter.h"
#endif // LIBC_COPT_PRINTF_DISABLE_WRITE_INT
// defines convert_pointer
-#include "src/stdio/printf_core/ptr_converter.h"
+#include "src/__support/printf_core/ptr_converter.h"
#ifndef LIBC_COPT_PRINTF_DISABLE_STRERROR
// defines convert_strerror
-#include "src/stdio/printf_core/strerror_converter.h"
+#include "src/__support/printf_core/strerror_converter.h"
#endif // LIBC_COPT_PRINTF_DISABLE_STRERROR
-#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_ATLAS_H
+#endif // LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CONVERTER_ATLAS_H
diff --git a/libc/src/stdio/printf_core/converter_utils.h b/libc/src/__support/printf_core/converter_utils.h
similarity index 92%
rename from libc/src/stdio/printf_core/converter_utils.h
rename to libc/src/__support/printf_core/converter_utils.h
index b27defddc354f..a21fb70f2f62a 100644
--- a/libc/src/stdio/printf_core/converter_utils.h
+++ b/libc/src/__support/printf_core/converter_utils.h
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_UTILS_H
-#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_UTILS_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CONVERTER_UTILS_H
+#define LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CONVERTER_UTILS_H
#include "src/__support/CPP/limits.h"
#include "src/__support/macros/config.h"
-#include "src/stdio/printf_core/core_structs.h"
+#include "src/__support/printf_core/core_structs.h"
#include <inttypes.h>
#include <stddef.h>
@@ -78,4 +78,4 @@ enum class RoundDirection { Up, Down, Even };
} // namespace printf_core
} // namespace LIBC_NAMESPACE_DECL
-#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_UTILS_H
+#endif // LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CONVERTER_UTILS_H
diff --git a/libc/src/stdio/printf_core/core_structs.h b/libc/src/__support/printf_core/core_structs.h
similarity index 95%
rename from libc/src/stdio/printf_core/core_structs.h
rename to libc/src/__support/printf_core/core_structs.h
index 9b74a0a391f95..3107b9ce46f00 100644
--- a/libc/src/stdio/printf_core/core_structs.h
+++ b/libc/src/__support/printf_core/core_structs.h
@@ -6,15 +6,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CORE_STRUCTS_H
-#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CORE_STRUCTS_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CORE_STRUCTS_H
+#define LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CORE_STRUCTS_H
#include "src/__support/macros/config.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/FPUtil/FPBits.h"
-#include "src/stdio/printf_core/printf_config.h"
+#include "src/__support/printf_core/printf_config.h"
#include <inttypes.h>
#include <stddef.h>
@@ -165,4 +165,4 @@ constexpr int MB_CONVERSION_ERROR = -1009;
} // namespace printf_core
} // namespace LIBC_NAMESPACE_DECL
-#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CORE_STRUCTS_H
+#endif // LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_CORE_STRUCTS_H
diff --git a/libc/src/stdio/printf_core/error_mapper.h b/libc/src/__support/printf_core/error_mapper.h
similarity index 76%
rename from libc/src/stdio/printf_core/error_mapper.h
rename to libc/src/__support/printf_core/error_mapper.h
index 23030930133a1..143ea94ce8963 100644
--- a/libc/src/stdio/printf_core/error_mapper.h
+++ b/libc/src/__support/printf_core/error_mapper.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_ERROR_MAPPER_H
-#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_ERROR_MAPPER_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_ERROR_MAPPER_H
+#define LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_ERROR_MAPPER_H
#include "src/__support/macros/properties/architectures.h"
@@ -18,4 +18,4 @@
#include "generic/error_mapper.h"
#endif
-#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_ERROR_MAPPER_H
+#endif // LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_ERROR_MAPPER_H
diff --git a/libc/src/stdio/printf_core/fixed_converter.h b/libc/src/__support/printf_core/fixed_converter.h
similarity index 97%
rename from libc/src/stdio/printf_core/fixed_converter.h
rename to libc/src/__support/printf_core/fixed_converter.h
index e8a3314967562..76b2d0d63644f 100644
--- a/libc/src/stdio/printf_core/fixed_converter.h
+++ b/libc/src/__support/printf_core/fixed_converter.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FIXED_CONVERTER_H
-#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FIXED_CONVERTER_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FIXED_CONVERTER_H
+#define LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FIXED_CONVERTER_H
#include "include/llvm-libc-macros/stdfix-macros.h"
#include "src/__support/CPP/string_view.h"
@@ -17,9 +17,9 @@
#include "src/__support/integer_to_string.h"
#include "src/__support/libc_assert.h"
#include "src/__support/macros/config.h"
-#include "src/stdio/printf_core/converter_utils.h"
-#include "src/stdio/printf_core/core_structs.h"
-#include "src/stdio/printf_core/writer.h"
+#include "src/__support/printf_core/converter_utils.h"
+#include "src/__support/printf_core/core_structs.h"
+#include "src/__support/printf_core/writer.h"
#include <inttypes.h>
#include <stddef.h>
@@ -307,4 +307,4 @@ LIBC_INLINE int convert_fixed(Writer<write_mode> *writer,
} // namespace printf_core
} // namespace LIBC_NAMESPACE_DECL
-#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FIXED_CONVERTER_H
+#endif // LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FIXED_CONVERTER_H
diff --git a/libc/src/stdio/printf_core/float_dec_converter.h b/libc/src/__support/printf_core/float_dec_converter.h
similarity index 99%
rename from libc/src/stdio/printf_core/float_dec_converter.h
rename to libc/src/__support/printf_core/float_dec_converter.h
index 7d86de3692115..b678cd29cdb81 100644
--- a/libc/src/stdio/printf_core/float_dec_converter.h
+++ b/libc/src/__support/printf_core/float_dec_converter.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_DEC_CONVERTER_H
-#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_DEC_CONVERTER_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FLOAT_DEC_CONVERTER_H
+#define LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FLOAT_DEC_CONVERTER_H
#include "src/__support/CPP/string_view.h"
#include "src/__support/FPUtil/FPBits.h"
@@ -18,10 +18,10 @@
#include "src/__support/integer_to_string.h"
#include "src/__support/libc_assert.h"
#include "src/__support/macros/config.h"
-#include "src/stdio/printf_core/converter_utils.h"
-#include "src/stdio/printf_core/core_structs.h"
-#include "src/stdio/printf_core/float_inf_nan_converter.h"
-#include "src/stdio/printf_core/writer.h"
+#include "src/__support/printf_core/converter_utils.h"
+#include "src/__support/printf_core/core_structs.h"
+#include "src/__support/printf_core/float_inf_nan_converter.h"
+#include "src/__support/printf_core/writer.h"
#include <inttypes.h>
#include <stddef.h>
@@ -1245,4 +1245,4 @@ LIBC_INLINE int convert_float_dec_auto(Writer<write_mode> *writer,
} // namespace printf_core
} // namespace LIBC_NAMESPACE_DECL
-#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_DEC_CONVERTER_H
+#endif // LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FLOAT_DEC_CONVERTER_H
diff --git a/libc/src/stdio/printf_core/float_dec_converter_limited.h b/libc/src/__support/printf_core/float_dec_converter_limited.h
similarity index 98%
rename from libc/src/stdio/printf_core/float_dec_converter_limited.h
rename to libc/src/__support/printf_core/float_dec_converter_limited.h
index 2693ebd531f96..2e34004ce92ca 100644
--- a/libc/src/stdio/printf_core/float_dec_converter_limited.h
+++ b/libc/src/__support/printf_core/float_dec_converter_limited.h
@@ -38,8 +38,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_DEC_CONVERTER_LIMITED_H
-#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_DEC_CONVERTER_LIMITED_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FLOAT_DEC_CONVERTER_LIMITED_H
+#define LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FLOAT_DEC_CONVERTER_LIMITED_H
#include "src/__support/CPP/algorithm.h"
#include "src/__support/CPP/string.h"
@@ -50,9 +50,9 @@
#include "src/__support/integer_to_string.h"
#include "src/__support/libc_assert.h"
#include "src/__support/macros/config.h"
-#include "src/stdio/printf_core/core_structs.h"
-#include "src/stdio/printf_core/float_inf_nan_converter.h"
-#include "src/stdio/printf_core/writer.h"
+#include "src/__support/printf_core/core_structs.h"
+#include "src/__support/printf_core/float_inf_nan_converter.h"
+#include "src/__support/printf_core/writer.h"
#include "src/string/memory_utils/inline_memcpy.h"
namespace LIBC_NAMESPACE_DECL {
@@ -711,4 +711,4 @@ LIBC_INLINE int convert_float_dec_auto(Writer<write_mode> *writer,
} // namespace printf_core
} // namespace LIBC_NAMESPACE_DECL
-#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_DEC_CONVERTER_LIMITED_H
+#endif // LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FLOAT_DEC_CONVERTER_LIMITED_H
diff --git a/libc/src/stdio/printf_core/float_hex_converter.h b/libc/src/__support/printf_core/float_hex_converter.h
similarity index 96%
rename from libc/src/stdio/printf_core/float_hex_converter.h
rename to libc/src/__support/printf_core/float_hex_converter.h
index 6ac3bfac8a76e..640db7be2c0f4 100644
--- a/libc/src/stdio/printf_core/float_hex_converter.h
+++ b/libc/src/__support/printf_core/float_hex_converter.h
@@ -6,18 +6,18 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_HEX_CONVERTER_H
-#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_HEX_CONVERTER_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FLOAT_HEX_CONVERTER_H
+#define LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FLOAT_HEX_CONVERTER_H
#include "src/__support/CPP/string_view.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/rounding_mode.h"
#include "src/__support/ctype_utils.h"
#include "src/__support/macros/config.h"
-#include "src/stdio/printf_core/converter_utils.h"
-#include "src/stdio/printf_core/core_structs.h"
-#include "src/stdio/printf_core/float_inf_nan_converter.h"
-#include "src/stdio/printf_core/writer.h"
+#include "src/__support/printf_core/converter_utils.h"
+#include "src/__support/printf_core/core_structs.h"
+#include "src/__support/printf_core/float_inf_nan_converter.h"
+#include "src/__support/printf_core/writer.h"
#include <inttypes.h>
#include <stddef.h>
@@ -298,4 +298,4 @@ LIBC_INLINE int convert_float_hex_exp(Writer<write_mode> *writer,
} // namespace printf_core
} // namespace LIBC_NAMESPACE_DECL
-#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_HEX_CONVERTER_H
+#endif // LLVM_LIBC_SRC___SUPPORT_PRINTF_CORE_FLOAT_HEX_CONVERTER_H
diff --git a/libc/src/stdio/printf_core/float_impl.cpp b/libc/src/__support/printf_core/float_impl.cpp
similarity index 94%
rename from libc/src/stdio/printf_core/float_impl.cpp
rename to libc/src/__support/printf_core/float_impl.cpp
index 92a616b955def..7e8fc6d983325 100644
--- a/libc/src/stdio/printf_core/float_impl.cpp
+++ b/libc/src/__support/printf_core/float_impl.cpp
@@ -16,7 +16,7 @@
#ifdef LIBC_COPT_PRINTF_MODULAR
#define LIBC_PRINTF_DEFINE_MODULES
-#include "src/stdio/printf_core/converter.h"
+#include "src/__support/printf_core/converter.h"
// Bring this file into the link if __printf_float is referenced.
extern "C" void __printf_float() {}
diff --git a/libc/src/stdio/printf_core/float...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/208303
More information about the libc-commits
mailing list