diff --git a/libc/src/__support/CPP/CMakeLists.txt b/libc/src/__support/CPP/CMakeLists.txt --- a/libc/src/__support/CPP/CMakeLists.txt +++ b/libc/src/__support/CPP/CMakeLists.txt @@ -79,7 +79,7 @@ add_header_library( utility HDRS - Utility.h + utility.h ) add_header_library( diff --git a/libc/src/__support/CPP/Utility.h b/libc/src/__support/CPP/utility.h rename from libc/src/__support/CPP/Utility.h rename to libc/src/__support/CPP/utility.h --- a/libc/src/__support/CPP/Utility.h +++ b/libc/src/__support/CPP/utility.h @@ -13,26 +13,27 @@ namespace __llvm_libc::cpp { -template struct IntegerSequence { +template struct integer_sequence { static_assert(is_integral_v); - template using append = IntegerSequence; + template using append = integer_sequence; }; namespace internal { -template struct MakeIntegerSequence { - using type = typename MakeIntegerSequence::type::template append; +template struct make_integer_sequence { + using type = + typename make_integer_sequence::type::template append; }; -template struct MakeIntegerSequence { - using type = IntegerSequence; +template struct make_integer_sequence { + using type = integer_sequence; }; } // namespace internal template -using MakeIntegerSequence = - typename internal::MakeIntegerSequence::type; +using make_integer_sequence = + typename internal::make_integer_sequence::type; } // namespace __llvm_libc::cpp diff --git a/libc/test/src/__support/CPP/integer_sequence_test.cpp b/libc/test/src/__support/CPP/integer_sequence_test.cpp --- a/libc/test/src/__support/CPP/integer_sequence_test.cpp +++ b/libc/test/src/__support/CPP/integer_sequence_test.cpp @@ -6,23 +6,24 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/CPP/Utility.h" +#include "src/__support/CPP/utility.h" #include "utils/UnitTest/Test.h" using namespace __llvm_libc::cpp; TEST(LlvmLibcIntegerSequencetTest, Basic) { - EXPECT_TRUE((is_same_v, MakeIntegerSequence>)); - using ISeq = IntegerSequence; - EXPECT_TRUE((is_same_v>)); - using LSeq = IntegerSequence; - EXPECT_TRUE((is_same_v>)); - using ULLSeq = IntegerSequence; - EXPECT_TRUE((is_same_v>)); + EXPECT_TRUE( + (is_same_v, make_integer_sequence>)); + using ISeq = integer_sequence; + EXPECT_TRUE((is_same_v>)); + using LSeq = integer_sequence; + EXPECT_TRUE((is_same_v>)); + using ULLSeq = integer_sequence; + EXPECT_TRUE( + (is_same_v>)); } -template -bool checkArray(IntegerSequence seq) { +template bool checkArray(integer_sequence seq) { T arr[sizeof...(Ts)]{Ts...}; for (T i = 0; i < static_cast(sizeof...(Ts)); i++) @@ -33,5 +34,5 @@ } TEST(LlvmLibcIntegerSequencetTest, Many) { - EXPECT_TRUE(checkArray(MakeIntegerSequence{})); + EXPECT_TRUE(checkArray(make_integer_sequence{})); } diff --git a/libc/test/src/stdlib/atexit_test.cpp b/libc/test/src/stdlib/atexit_test.cpp --- a/libc/test/src/stdlib/atexit_test.cpp +++ b/libc/test/src/stdlib/atexit_test.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/CPP/Utility.h" #include "src/__support/CPP/array.h" +#include "src/__support/CPP/utility.h" #include "src/stdlib/atexit.h" #include "src/stdlib/exit.h" #include "utils/UnitTest/Test.h" @@ -43,7 +43,7 @@ static __llvm_libc::cpp::array arr; template -void register_atexit_handlers(__llvm_libc::cpp::IntegerSequence) { +void register_atexit_handlers(__llvm_libc::cpp::integer_sequence) { (__llvm_libc::atexit(+[] { arr[size++] = Ts; }), ...); } @@ -57,7 +57,7 @@ __builtin_trap(); }); register_atexit_handlers( - __llvm_libc::cpp::MakeIntegerSequence{}); + __llvm_libc::cpp::make_integer_sequence{}); __llvm_libc::exit(0); }; } diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel @@ -107,7 +107,7 @@ cc_library( name = "__support_cpp_utility", - hdrs = ["src/__support/CPP/Utility.h"], + hdrs = ["src/__support/CPP/utility.h"], deps = [ ":__support_cpp_type_traits", ":libc_root",