James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame^] | 1 | From c26562caae6a685716a8785ad8689833c9996549 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 07/28] Explicitly use std:: |
| 5 | |
| 6 | --- |
| 7 | llvm/include/llvm/ADT/SmallSet.h | 2 +- |
| 8 | llvm/include/llvm/Support/MathExtras.h | 2 +- |
| 9 | llvm/lib/Support/ErrorHandling.cpp | 2 +- |
| 10 | llvm/unittests/ADT/SmallPtrSetTest.cpp | 2 +- |
| 11 | llvm/unittests/ADT/StringMapTest.cpp | 2 +- |
| 12 | 5 files changed, 5 insertions(+), 5 deletions(-) |
| 13 | |
| 14 | diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h |
| 15 | index bfe93e997..403e108fd 100644 |
| 16 | --- a/llvm/include/llvm/ADT/SmallSet.h |
| 17 | +++ b/llvm/include/llvm/ADT/SmallSet.h |
| 18 | @@ -270,7 +270,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/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h |
| 28 | index db9fbc148..da843ef79 100644 |
| 29 | --- a/llvm/include/llvm/Support/MathExtras.h |
| 30 | +++ b/llvm/include/llvm/Support/MathExtras.h |
| 31 | @@ -586,7 +586,7 @@ inline double Log2(double Value) { |
| 32 | #if defined(__ANDROID_API__) && __ANDROID_API__ < 18 |
| 33 | return __builtin_log(Value) / __builtin_log(2.0); |
| 34 | #else |
| 35 | - return log2(Value); |
| 36 | + return std::log2(Value); |
| 37 | #endif |
| 38 | } |
| 39 | |
| 40 | diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp |
| 41 | index 89440b5ab..f80e28e87 100644 |
| 42 | --- a/llvm/lib/Support/ErrorHandling.cpp |
| 43 | +++ b/llvm/lib/Support/ErrorHandling.cpp |
| 44 | @@ -210,7 +210,7 @@ void LLVMResetFatalErrorHandler() { |
| 45 | // I'd rather not double the line count of the following. |
| 46 | #define MAP_ERR_TO_COND(x, y) \ |
| 47 | case x: \ |
| 48 | - return make_error_code(errc::y) |
| 49 | + return std::make_error_code(std::errc::y) |
| 50 | |
| 51 | std::error_code llvm::mapWindowsError(unsigned EV) { |
| 52 | switch (EV) { |
| 53 | diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp |
| 54 | index 6f3c94eed..531f81ab5 100644 |
| 55 | --- a/llvm/unittests/ADT/SmallPtrSetTest.cpp |
| 56 | +++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp |
| 57 | @@ -298,7 +298,7 @@ TEST(SmallPtrSetTest, dereferenceAndIterate) { |
| 58 | |
| 59 | // Sort. We should hit the first element just once and the final element N |
| 60 | // times. |
| 61 | - llvm::sort(std::begin(Found), std::end(Found)); |
| 62 | + std::sort(std::begin(Found), std::end(Found)); |
| 63 | for (auto F = std::begin(Found), E = std::end(Found); F != E; ++F) |
| 64 | EXPECT_EQ(F - Found + 1, *F); |
| 65 | } |
| 66 | diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp |
| 67 | index 86907ab61..6d0c0942c 100644 |
| 68 | --- a/llvm/unittests/ADT/StringMapTest.cpp |
| 69 | +++ b/llvm/unittests/ADT/StringMapTest.cpp |
| 70 | @@ -329,7 +329,7 @@ TEST_F(StringMapTest, IterMapKeysSmallVector) { |
| 71 | Map["D"] = 3; |
| 72 | |
| 73 | auto Keys = to_vector<4>(Map.keys()); |
| 74 | - llvm::sort(Keys); |
| 75 | + std::sort(Keys.begin(), Keys.end()); |
| 76 | |
| 77 | SmallVector<std::string_view, 4> Expected = {"A", "B", "C", "D"}; |
| 78 | EXPECT_EQ(Expected, Keys); |