aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@redhat.com>2022-01-26 10:11:12 -0500
committerserge-sans-paille <sguelton@redhat.com>2022-01-26 16:17:45 +0100
commitef8206320769ad31422a803a0d6de6077fd231d2 (patch)
tree06ca6445f38939d6a543e0a64c2ede55497a06cd /llvm/unittests/Support/CommandLineTest.cpp
parent99ae5c13f64e138d6b17c00bd01c87c3ce58cb6b (diff)
downloadllvm-ef8206320769ad31422a803a0d6de6077fd231d2.zip
llvm-ef8206320769ad31422a803a0d6de6077fd231d2.tar.gz
llvm-ef8206320769ad31422a803a0d6de6077fd231d2.tar.bz2
Rename llvm::array_lengthof into llvm::size to match std::size from C++17
As a conquence move llvm::array_lengthof from STLExtras.h to STLForwardCompat.h (which is included by STLExtras.h so no build breakage expected).
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index 8032d0e7..695bb70 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -345,7 +345,7 @@ TEST(CommandLineTest, AliasesWithArguments) {
{ "-tool", "-alias", "x" }
};
- for (size_t i = 0, e = array_lengthof(Inputs); i < e; ++i) {
+ for (size_t i = 0, e = size(Inputs); i < e; ++i) {
StackOption<std::string> Actual("actual");
StackOption<bool> Extra("extra");
StackOption<std::string> Input(cl::Positional);
@@ -374,8 +374,8 @@ void testAliasRequired(int argc, const char *const *argv) {
TEST(CommandLineTest, AliasRequired) {
const char *opts1[] = { "-tool", "-option=x" };
const char *opts2[] = { "-tool", "-o", "x" };
- testAliasRequired(array_lengthof(opts1), opts1);
- testAliasRequired(array_lengthof(opts2), opts2);
+ testAliasRequired(size(opts1), opts1);
+ testAliasRequired(size(opts2), opts2);
}
TEST(CommandLineTest, HideUnrelatedOptions) {
@@ -987,8 +987,8 @@ TEST(CommandLineTest, ResponseFileEOLs) {
/*CurrentDir=*/StringRef(TestRoot), FS));
const char *Expected[] = {"clang", "-Xclang", "-Wno-whatever", nullptr,
"input.cpp"};
- ASSERT_EQ(array_lengthof(Expected), Argv.size());
- for (size_t I = 0, E = array_lengthof(Expected); I < E; ++I) {
+ ASSERT_EQ(size(Expected), Argv.size());
+ for (size_t I = 0, E = size(Expected); I < E; ++I) {
if (Expected[I] == nullptr) {
ASSERT_EQ(Argv[I], nullptr);
} else {