Index: llvm/trunk/lib/Analysis/BlockFrequencyInfoImpl.cpp =================================================================== --- llvm/trunk/lib/Analysis/BlockFrequencyInfoImpl.cpp +++ llvm/trunk/lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -155,9 +155,9 @@ static void combineWeightsBySorting(WeightList &Weights) { // Sort so edges to the same node are adjacent. - std::sort(Weights.begin(), Weights.end(), - [](const Weight &L, - const Weight &R) { return L.TargetNode < R.TargetNode; }); + llvm::sort(Weights.begin(), Weights.end(), + [](const Weight &L, + const Weight &R) { return L.TargetNode < R.TargetNode; }); // Combine adjacent edges. WeightList::iterator O = Weights.begin(); @@ -702,7 +702,7 @@ "Expected irreducible CFG; -loop-info is likely invalid"); if (Headers.size() == InSCC.size()) { // Every block is a header. - std::sort(Headers.begin(), Headers.end()); + llvm::sort(Headers.begin(), Headers.end()); return; } @@ -736,8 +736,8 @@ Others.push_back(Irr.Node); DEBUG(dbgs() << " => other = " << BFI.getBlockName(Irr.Node) << "\n"); } - std::sort(Headers.begin(), Headers.end()); - std::sort(Others.begin(), Others.end()); + llvm::sort(Headers.begin(), Headers.end()); + llvm::sort(Others.begin(), Others.end()); } static void createIrreducibleLoop( Index: llvm/trunk/lib/Analysis/CFLAndersAliasAnalysis.cpp =================================================================== --- llvm/trunk/lib/Analysis/CFLAndersAliasAnalysis.cpp +++ llvm/trunk/lib/Analysis/CFLAndersAliasAnalysis.cpp @@ -395,7 +395,7 @@ } // Sort AliasList for faster lookup - std::sort(AliasList.begin(), AliasList.end()); + llvm::sort(AliasList.begin(), AliasList.end()); } } @@ -479,7 +479,7 @@ } // Remove duplicates in ExtRelations - std::sort(ExtRelations.begin(), ExtRelations.end()); + llvm::sort(ExtRelations.begin(), ExtRelations.end()); ExtRelations.erase(std::unique(ExtRelations.begin(), ExtRelations.end()), ExtRelations.end()); } Index: llvm/trunk/lib/Analysis/CallGraph.cpp =================================================================== --- llvm/trunk/lib/Analysis/CallGraph.cpp +++ llvm/trunk/lib/Analysis/CallGraph.cpp @@ -96,8 +96,8 @@ for (const auto &I : *this) Nodes.push_back(I.second.get()); - std::sort(Nodes.begin(), Nodes.end(), - [](CallGraphNode *LHS, CallGraphNode *RHS) { + llvm::sort(Nodes.begin(), Nodes.end(), + [](CallGraphNode *LHS, CallGraphNode *RHS) { if (Function *LF = LHS->getFunction()) if (Function *RF = RHS->getFunction()) return LF->getName() < RF->getName(); Index: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp =================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -805,7 +805,7 @@ DirtyBlocks.push_back(Entry.getBB()); // Sort the cache so that we can do fast binary search lookups below. - std::sort(Cache.begin(), Cache.end()); + llvm::sort(Cache.begin(), Cache.end()); ++NumCacheDirtyNonLocal; // cerr << "CACHED CASE: " << DirtyBlocks.size() << " dirty: " @@ -1068,7 +1068,7 @@ break; default: // Added many values, do a full scale sort. - std::sort(Cache.begin(), Cache.end()); + llvm::sort(Cache.begin(), Cache.end()); break; } } @@ -1638,7 +1638,7 @@ // Re-sort the NonLocalDepInfo. Changing the dirty entry to its // subsequent value may invalidate the sortedness. - std::sort(NLPDI.begin(), NLPDI.end()); + llvm::sort(NLPDI.begin(), NLPDI.end()); } ReverseNonLocalPtrDeps.erase(ReversePtrDepIt); Index: llvm/trunk/lib/Analysis/MemorySSA.cpp =================================================================== --- llvm/trunk/lib/Analysis/MemorySSA.cpp +++ llvm/trunk/lib/Analysis/MemorySSA.cpp @@ -1338,10 +1338,10 @@ SmallVector IDFBlocks; IDFs.calculate(IDFBlocks); - std::sort(IDFBlocks.begin(), IDFBlocks.end(), - [&BBNumbers](const BasicBlock *A, const BasicBlock *B) { - return BBNumbers.lookup(A) < BBNumbers.lookup(B); - }); + llvm::sort(IDFBlocks.begin(), IDFBlocks.end(), + [&BBNumbers](const BasicBlock *A, const BasicBlock *B) { + return BBNumbers.lookup(A) < BBNumbers.lookup(B); + }); // Now place MemoryPhi nodes. for (auto &BB : IDFBlocks) Index: llvm/trunk/lib/Analysis/ScalarEvolution.cpp =================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp @@ -10645,7 +10645,7 @@ Terms.erase(std::unique(Terms.begin(), Terms.end()), Terms.end()); // Put larger terms first. - std::sort(Terms.begin(), Terms.end(), [](const SCEV *LHS, const SCEV *RHS) { + llvm::sort(Terms.begin(), Terms.end(), [](const SCEV *LHS, const SCEV *RHS) { return numberOfTerms(LHS) > numberOfTerms(RHS); }); Index: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp =================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp +++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp @@ -1862,7 +1862,7 @@ Phis.push_back(&PN); if (TTI) - std::sort(Phis.begin(), Phis.end(), [](Value *LHS, Value *RHS) { + llvm::sort(Phis.begin(), Phis.end(), [](Value *LHS, Value *RHS) { // Put pointers at the back and make sure pointer < pointer = false. if (!LHS->getType()->isIntegerTy() || !RHS->getType()->isIntegerTy()) return RHS->getType()->isIntegerTy() && !LHS->getType()->isIntegerTy(); Index: llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp =================================================================== --- llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp +++ llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp @@ -1329,10 +1329,10 @@ void TargetLibraryInfoImpl::addVectorizableFunctions(ArrayRef Fns) { VectorDescs.insert(VectorDescs.end(), Fns.begin(), Fns.end()); - std::sort(VectorDescs.begin(), VectorDescs.end(), compareByScalarFnName); + llvm::sort(VectorDescs.begin(), VectorDescs.end(), compareByScalarFnName); ScalarDescs.insert(ScalarDescs.end(), Fns.begin(), Fns.end()); - std::sort(ScalarDescs.begin(), ScalarDescs.end(), compareByVectorFnName); + llvm::sort(ScalarDescs.begin(), ScalarDescs.end(), compareByVectorFnName); } void TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib(