aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/StringRefTest.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2022-01-26 16:55:53 +0100
committerBenjamin Kramer <benny.kra@googlemail.com>2022-01-26 16:55:53 +0100
commitf15014ff549a8686671a599f7b49ce9963769eaf (patch)
treec71b273ecd3983fba8bfd6777b534c045b120619 /llvm/unittests/ADT/StringRefTest.cpp
parent297bbf106288b0d673709ca02917d82e7bebdf1a (diff)
downloadllvm-f15014ff549a8686671a599f7b49ce9963769eaf.zip
llvm-f15014ff549a8686671a599f7b49ce9963769eaf.tar.gz
llvm-f15014ff549a8686671a599f7b49ce9963769eaf.tar.bz2
Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17"
This reverts commit ef8206320769ad31422a803a0d6de6077fd231d2. - It conflicts with the existing llvm::size in STLExtras, which will now never be called. - Calling it without llvm:: breaks C++17 compat
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r--llvm/unittests/ADT/StringRefTest.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp
index 114c097..e80a25a 100644
--- a/llvm/unittests/ADT/StringRefTest.cpp
+++ b/llvm/unittests/ADT/StringRefTest.cpp
@@ -659,7 +659,7 @@ TEST(StringRefTest, getAsInteger) {
uint32_t U32;
uint64_t U64;
- for (size_t i = 0; i < size(Unsigned); ++i) {
+ for (size_t i = 0; i < array_lengthof(Unsigned); ++i) {
bool U8Success = StringRef(Unsigned[i].Str).getAsInteger(0, U8);
if (static_cast<uint8_t>(Unsigned[i].Expected) == Unsigned[i].Expected) {
ASSERT_FALSE(U8Success);
@@ -691,7 +691,7 @@ TEST(StringRefTest, getAsInteger) {
int32_t S32;
int64_t S64;
- for (size_t i = 0; i < size(Signed); ++i) {
+ for (size_t i = 0; i < array_lengthof(Signed); ++i) {
bool S8Success = StringRef(Signed[i].Str).getAsInteger(0, S8);
if (static_cast<int8_t>(Signed[i].Expected) == Signed[i].Expected) {
ASSERT_FALSE(S8Success);
@@ -737,7 +737,7 @@ static const char* BadStrings[] = {
TEST(StringRefTest, getAsUnsignedIntegerBadStrings) {
unsigned long long U64;
- for (size_t i = 0; i < size(BadStrings); ++i) {
+ for (size_t i = 0; i < array_lengthof(BadStrings); ++i) {
bool IsBadNumber = StringRef(BadStrings[i]).getAsInteger(0, U64);
ASSERT_TRUE(IsBadNumber);
}
@@ -820,7 +820,7 @@ TEST(StringRefTest, consumeIntegerUnsigned) {
uint32_t U32;
uint64_t U64;
- for (size_t i = 0; i < size(ConsumeUnsigned); ++i) {
+ for (size_t i = 0; i < array_lengthof(ConsumeUnsigned); ++i) {
StringRef Str = ConsumeUnsigned[i].Str;
bool U8Success = Str.consumeInteger(0, U8);
if (static_cast<uint8_t>(ConsumeUnsigned[i].Expected) ==
@@ -868,7 +868,7 @@ TEST(StringRefTest, consumeIntegerSigned) {
int32_t S32;
int64_t S64;
- for (size_t i = 0; i < size(ConsumeSigned); ++i) {
+ for (size_t i = 0; i < array_lengthof(ConsumeSigned); ++i) {
StringRef Str = ConsumeSigned[i].Str;
bool S8Success = Str.consumeInteger(0, S8);
if (static_cast<int8_t>(ConsumeSigned[i].Expected) ==
@@ -945,7 +945,7 @@ static const char join_result3[] = "a::b::c";
TEST(StringRefTest, joinStrings) {
std::vector<StringRef> v1;
std::vector<std::string> v2;
- for (size_t i = 0; i < size(join_input); ++i) {
+ for (size_t i = 0; i < array_lengthof(join_input); ++i) {
v1.push_back(join_input[i]);
v2.push_back(join_input[i]);
}