Index: unittests/ADT/STLExtrasTest.cpp =================================================================== --- unittests/ADT/STLExtrasTest.cpp +++ unittests/ADT/STLExtrasTest.cpp @@ -302,8 +302,8 @@ ASSERT_EQ(V.begin() + 4, I); // Sort the two halves as partition may have messed with the order. - std::sort(V.begin(), I); - std::sort(I, V.end()); + llvm::sort(V.begin(), I); + llvm::sort(I, V.end()); EXPECT_EQ(2, V[0]); EXPECT_EQ(4, V[1]); Index: unittests/ADT/SmallPtrSetTest.cpp =================================================================== --- unittests/ADT/SmallPtrSetTest.cpp +++ unittests/ADT/SmallPtrSetTest.cpp @@ -299,7 +299,7 @@ // Sort. We should hit the first element just once and the final element N // times. - std::sort(std::begin(Found), std::end(Found)); + llvm::sort(std::begin(Found), std::end(Found)); for (auto F = std::begin(Found), E = std::end(Found); F != E; ++F) EXPECT_EQ(F - Found + 1, *F); } Index: unittests/ADT/StringMapTest.cpp =================================================================== --- unittests/ADT/StringMapTest.cpp +++ unittests/ADT/StringMapTest.cpp @@ -279,7 +279,7 @@ Map["D"] = 3; auto Keys = to_vector<4>(Map.keys()); - std::sort(Keys.begin(), Keys.end()); + llvm::sort(Keys.begin(), Keys.end()); SmallVector Expected = {"A", "B", "C", "D"}; EXPECT_EQ(Expected, Keys); @@ -293,7 +293,7 @@ Set.insert("D"); auto Keys = to_vector<4>(Set.keys()); - std::sort(Keys.begin(), Keys.end()); + llvm::sort(Keys.begin(), Keys.end()); SmallVector Expected = {"A", "B", "C", "D"}; EXPECT_EQ(Expected, Keys); Index: unittests/Analysis/LazyCallGraphTest.cpp =================================================================== --- unittests/Analysis/LazyCallGraphTest.cpp +++ unittests/Analysis/LazyCallGraphTest.cpp @@ -264,7 +264,7 @@ for (LazyCallGraph::Edge &E : A1.populate()) Nodes.push_back(E.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ("a2", Nodes[0]); EXPECT_EQ("b2", Nodes[1]); EXPECT_EQ("c3", Nodes[2]); @@ -279,7 +279,7 @@ for (LazyCallGraph::Edge &E : B1.populate()) Nodes.push_back(E.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ("b2", Nodes[0]); EXPECT_EQ("d3", Nodes[1]); Nodes.clear(); @@ -293,7 +293,7 @@ for (LazyCallGraph::Edge &E : C1.populate()) Nodes.push_back(E.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ("c2", Nodes[0]); EXPECT_EQ("d2", Nodes[1]); Nodes.clear(); @@ -323,7 +323,7 @@ ASSERT_EQ(1, D.size()); for (LazyCallGraph::Node &N : *D.begin()) Nodes.push_back(N.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("d1", Nodes[0]); EXPECT_EQ("d2", Nodes[1]); @@ -339,7 +339,7 @@ ASSERT_EQ(1, C.size()); for (LazyCallGraph::Node &N : *C.begin()) Nodes.push_back(N.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("c1", Nodes[0]); EXPECT_EQ("c2", Nodes[1]); @@ -355,7 +355,7 @@ ASSERT_EQ(1, B.size()); for (LazyCallGraph::Node &N : *B.begin()) Nodes.push_back(N.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("b1", Nodes[0]); EXPECT_EQ("b2", Nodes[1]); @@ -373,7 +373,7 @@ ASSERT_EQ(1, A.size()); for (LazyCallGraph::Node &N : *A.begin()) Nodes.push_back(N.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("a1", Nodes[0]); EXPECT_EQ("a2", Nodes[1]); @@ -477,7 +477,7 @@ LazyCallGraph::SCC &D = *J++; for (LazyCallGraph::Node &N : D) Nodes.push_back(N.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("d1", Nodes[0]); EXPECT_EQ("d2", Nodes[1]); @@ -487,7 +487,7 @@ LazyCallGraph::SCC &B = *J++; for (LazyCallGraph::Node &N : B) Nodes.push_back(N.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("b1", Nodes[0]); EXPECT_EQ("b2", Nodes[1]); @@ -497,7 +497,7 @@ LazyCallGraph::SCC &C = *J++; for (LazyCallGraph::Node &N : C) Nodes.push_back(N.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("c1", Nodes[0]); EXPECT_EQ("c2", Nodes[1]); @@ -507,7 +507,7 @@ LazyCallGraph::SCC &A = *J++; for (LazyCallGraph::Node &N : A) Nodes.push_back(N.getFunction().getName()); - std::sort(Nodes.begin(), Nodes.end()); + llvm::sort(Nodes.begin(), Nodes.end()); EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("a1", Nodes[0]); EXPECT_EQ("a2", Nodes[1]); Index: unittests/ProfileData/InstrProfTest.cpp =================================================================== --- unittests/ProfileData/InstrProfTest.cpp +++ unittests/ProfileData/InstrProfTest.cpp @@ -712,7 +712,7 @@ }; std::unique_ptr VD_0( Record.getValueForSite(IPVK_IndirectCallTarget, 0)); - std::sort(&VD_0[0], &VD_0[5], Cmp); + llvm::sort(&VD_0[0], &VD_0[5], Cmp); ASSERT_EQ(StringRef((const char *)VD_0[0].Value, 7), StringRef("callee2")); ASSERT_EQ(1000U, VD_0[0].Count); ASSERT_EQ(StringRef((const char *)VD_0[1].Value, 7), StringRef("callee3")); @@ -726,7 +726,7 @@ std::unique_ptr VD_1( Record.getValueForSite(IPVK_IndirectCallTarget, 1)); - std::sort(&VD_1[0], &VD_1[4], Cmp); + llvm::sort(&VD_1[0], &VD_1[4], Cmp); ASSERT_EQ(StringRef((const char *)VD_1[0].Value, 7), StringRef("callee2")); ASSERT_EQ(2500U, VD_1[0].Count); ASSERT_EQ(StringRef((const char *)VD_1[1].Value, 7), StringRef("callee1")); @@ -738,7 +738,7 @@ std::unique_ptr VD_2( Record.getValueForSite(IPVK_IndirectCallTarget, 2)); - std::sort(&VD_2[0], &VD_2[3], Cmp); + llvm::sort(&VD_2[0], &VD_2[3], Cmp); ASSERT_EQ(StringRef((const char *)VD_2[0].Value, 7), StringRef("callee4")); ASSERT_EQ(5500U, VD_2[0].Count); ASSERT_EQ(StringRef((const char *)VD_2[1].Value, 7), StringRef("callee3")); @@ -748,7 +748,7 @@ std::unique_ptr VD_3( Record.getValueForSite(IPVK_IndirectCallTarget, 3)); - std::sort(&VD_3[0], &VD_3[2], Cmp); + llvm::sort(&VD_3[0], &VD_3[2], Cmp); ASSERT_EQ(StringRef((const char *)VD_3[0].Value, 7), StringRef("callee3")); ASSERT_EQ(2000U, VD_3[0].Count); ASSERT_EQ(StringRef((const char *)VD_3[1].Value, 7), StringRef("callee2")); @@ -781,7 +781,7 @@ }; std::unique_ptr VD_0( Record.getValueForSite(IPVK_IndirectCallTarget, 0)); - std::sort(&VD_0[0], &VD_0[5], Cmp); + llvm::sort(&VD_0[0], &VD_0[5], Cmp); ASSERT_EQ(VD_0[0].Value, 0x2000ULL); ASSERT_EQ(1000U, VD_0[0].Count); ASSERT_EQ(VD_0[1].Value, 0x3000ULL); Index: unittests/Support/Path.cpp =================================================================== --- unittests/Support/Path.cpp +++ unittests/Support/Path.cpp @@ -895,7 +895,7 @@ ASSERT_NO_ERROR(ec); visited.push_back(path::filename(i->path())); } - std::sort(visited.begin(), visited.end()); + llvm::sort(visited.begin(), visited.end()); v_t expected = {"a", "b", "c", "d", "e"}; ASSERT_TRUE(visited.size() == expected.size()); ASSERT_TRUE(std::equal(visited.begin(), visited.end(), expected.begin())); @@ -918,7 +918,7 @@ visited.push_back(path::filename(i->path())); } - std::sort(visited.begin(), visited.end()); + llvm::sort(visited.begin(), visited.end()); expected = {"b", "bb", "d", "da", "dd", "ddd", "ddd"}; ASSERT_TRUE(visited.size() == expected.size()); ASSERT_TRUE(std::equal(visited.begin(), visited.end(), expected.begin())); @@ -933,7 +933,7 @@ ASSERT_NO_ERROR(ec); visited.push_back(path::filename(i->path())); } - std::sort(visited.begin(), visited.end()); + llvm::sort(visited.begin(), visited.end()); expected = {"a", "b", "ba", "bb", "bc", "c", "d", "da", "dd", "ddd", "e"}; ASSERT_TRUE(visited.size() == expected.size()); ASSERT_TRUE(std::equal(visited.begin(), visited.end(), expected.begin())); Index: utils/unittest/googlemock/include/gmock/gmock-matchers.h =================================================================== --- utils/unittest/googlemock/include/gmock/gmock-matchers.h +++ utils/unittest/googlemock/include/gmock/gmock-matchers.h @@ -2654,7 +2654,7 @@ LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs); ::std::vector sorted_container(lhs_stl_container.begin(), lhs_stl_container.end()); - ::std::sort( + ::llvm::sort( sorted_container.begin(), sorted_container.end(), comparator_); if (!listener->IsInterested()) {