James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | From: PJ Reiniger <pj.reiniger@gmail.com> |
| 3 | Date: Sat, 7 May 2022 22:37:34 -0400 |
| 4 | Subject: [PATCH 06/31] Explicitly use std:: |
| 5 | |
| 6 | --- |
| 7 | llvm/include/llvm/ADT/SmallSet.h | 2 +- |
| 8 | llvm/lib/Support/ErrorHandling.cpp | 2 +- |
| 9 | llvm/unittests/ADT/SmallPtrSetTest.cpp | 2 +- |
| 10 | llvm/unittests/ADT/SmallSetTest.cpp | 10 +++++----- |
| 11 | llvm/unittests/ADT/StringMapTest.cpp | 2 +- |
| 12 | 5 files changed, 9 insertions(+), 9 deletions(-) |
| 13 | |
| 14 | diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h |
| 15 | index aeee5f97799aea7e7588d7afba1e47b4fa3d8c7b..4969dfb0d61c2fad805c9cb7bc0184ea6d47bf23 100644 |
| 16 | --- a/llvm/include/llvm/ADT/SmallSet.h |
| 17 | +++ b/llvm/include/llvm/ADT/SmallSet.h |
| 18 | @@ -269,7 +269,7 @@ bool operator==(const SmallSet<T, LN, C> &LHS, const SmallSet<T, RN, C> &RHS) { |
| 19 | return false; |
| 20 | |
| 21 | // All elements in LHS must also be in RHS |
| 22 | - return all_of(LHS, [&RHS](const T &E) { return RHS.count(E); }); |
| 23 | + return std::all_of(LHS.begin(), LHS.end(), [&RHS](const T &E) { return RHS.count(E); }); |
| 24 | } |
| 25 | |
| 26 | /// Inequality comparison for SmallSet. |
| 27 | diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp |
| 28 | index 637b669a7d0dae69ef4b34955f21a9fb8ba1276e..0b87b375de67dc18647e3ebe646bf323dd05e8c5 100644 |
| 29 | --- a/llvm/lib/Support/ErrorHandling.cpp |
| 30 | +++ b/llvm/lib/Support/ErrorHandling.cpp |
| 31 | @@ -213,7 +213,7 @@ void LLVMResetFatalErrorHandler() { |
| 32 | // I'd rather not double the line count of the following. |
| 33 | #define MAP_ERR_TO_COND(x, y) \ |
| 34 | case x: \ |
| 35 | - return make_error_code(errc::y) |
| 36 | + return std::make_error_code(std::errc::y) |
| 37 | |
| 38 | std::error_code llvm::mapWindowsError(unsigned EV) { |
| 39 | switch (EV) { |
| 40 | diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp |
| 41 | index 7ed8670fd31ea2a14e6ba7f59a8ac8e35046890c..531f81ab5b3fc1dcff731230f3cb7649cb90aedf 100644 |
| 42 | --- a/llvm/unittests/ADT/SmallPtrSetTest.cpp |
| 43 | +++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp |
| 44 | @@ -298,7 +298,7 @@ TEST(SmallPtrSetTest, dereferenceAndIterate) { |
| 45 | |
| 46 | // Sort. We should hit the first element just once and the final element N |
| 47 | // times. |
| 48 | - llvm::sort(Found); |
| 49 | + std::sort(std::begin(Found), std::end(Found)); |
| 50 | for (auto F = std::begin(Found), E = std::end(Found); F != E; ++F) |
| 51 | EXPECT_EQ(F - Found + 1, *F); |
| 52 | } |
| 53 | diff --git a/llvm/unittests/ADT/SmallSetTest.cpp b/llvm/unittests/ADT/SmallSetTest.cpp |
| 54 | index b50b368ae663614f050c220432c05b32c201db00..f9d84fa8a42a7feaaffa3aa080e84574dc3671b3 100644 |
| 55 | --- a/llvm/unittests/ADT/SmallSetTest.cpp |
| 56 | +++ b/llvm/unittests/ADT/SmallSetTest.cpp |
| 57 | @@ -11,8 +11,8 @@ |
| 58 | //===----------------------------------------------------------------------===// |
| 59 | |
| 60 | #include "llvm/ADT/SmallSet.h" |
| 61 | -#include "llvm/ADT/STLExtras.h" |
| 62 | #include "gtest/gtest.h" |
| 63 | +#include <algorithm> |
| 64 | #include <string> |
| 65 | |
| 66 | using namespace llvm; |
| 67 | @@ -94,7 +94,7 @@ TEST(SmallSetTest, IteratorInt) { |
| 68 | |
| 69 | std::vector<int> V(s1.begin(), s1.end()); |
| 70 | // Make sure the elements are in the expected order. |
| 71 | - llvm::sort(V); |
| 72 | + std::sort(V.begin(), V.end()); |
| 73 | for (int i = 0; i < 3; i++) |
| 74 | EXPECT_EQ(i, V[i]); |
| 75 | |
| 76 | @@ -105,7 +105,7 @@ TEST(SmallSetTest, IteratorInt) { |
| 77 | |
| 78 | V.assign(s1.begin(), s1.end()); |
| 79 | // Make sure the elements are in the expected order. |
| 80 | - llvm::sort(V); |
| 81 | + std::sort(V.begin(), V.end()); |
| 82 | for (int i = 0; i < 6; i++) |
| 83 | EXPECT_EQ(i, V[i]); |
| 84 | } |
| 85 | @@ -120,7 +120,7 @@ TEST(SmallSetTest, IteratorString) { |
| 86 | s1.insert("str 1"); |
| 87 | |
| 88 | std::vector<std::string> V(s1.begin(), s1.end()); |
| 89 | - llvm::sort(V); |
| 90 | + std::sort(V.begin(), V.end()); |
| 91 | EXPECT_EQ(2u, s1.size()); |
| 92 | EXPECT_EQ("str 1", V[0]); |
| 93 | EXPECT_EQ("str 2", V[1]); |
| 94 | @@ -131,7 +131,7 @@ TEST(SmallSetTest, IteratorString) { |
| 95 | |
| 96 | V.assign(s1.begin(), s1.end()); |
| 97 | // Make sure the elements are in the expected order. |
| 98 | - llvm::sort(V); |
| 99 | + std::sort(V.begin(), V.end()); |
| 100 | EXPECT_EQ(4u, s1.size()); |
| 101 | EXPECT_EQ("str 0", V[0]); |
| 102 | EXPECT_EQ("str 1", V[1]); |
| 103 | diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp |
| 104 | index 7f10b3d7d3a8894b1ab0ac660268d94a8b89e082..acd8b566f9c7a6efc2c9204624c01104dd34daf6 100644 |
| 105 | --- a/llvm/unittests/ADT/StringMapTest.cpp |
| 106 | +++ b/llvm/unittests/ADT/StringMapTest.cpp |
| 107 | @@ -343,7 +343,7 @@ TEST_F(StringMapTest, IterMapKeysSmallVector) { |
| 108 | Map["D"] = 3; |
| 109 | |
| 110 | auto Keys = to_vector<4>(Map.keys()); |
| 111 | - llvm::sort(Keys); |
| 112 | + std::sort(Keys.begin(), Keys.end()); |
| 113 | |
| 114 | SmallVector<std::string_view, 4> Expected = {"A", "B", "C", "D"}; |
| 115 | EXPECT_EQ(Expected, Keys); |