From: Benjamin Kramer Date: Sun, 2 Mar 2014 12:20:24 +0000 (+0000) Subject: [C++11] Replace llvm::next and llvm::prior with std::next and std::prev. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1824794b41bbf858f582656ace9e649753f33ccf;p=clang [C++11] Replace llvm::next and llvm::prior with std::next and std::prev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202635 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 78bd037e83..653b5a2bd4 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -2246,7 +2246,7 @@ Value *ScalarExprEmitter::EmitOverflowCheckedBinOp(const BinOpInfo &Ops) { llvm::BasicBlock *initialBB = Builder.GetInsertBlock(); llvm::Function::iterator insertPt = initialBB; llvm::BasicBlock *continueBB = CGF.createBasicBlock("nooverflow", CGF.CurFn, - llvm::next(insertPt)); + std::next(insertPt)); llvm::BasicBlock *overflowBB = CGF.createBasicBlock("overflow", CGF.CurFn); Builder.CreateCondBr(overflow, overflowBB, continueBB); diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 5df0a43621..f975aa0a7b 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -3504,7 +3504,7 @@ void TypoCorrectionConsumer::addCorrection(TypoCorrection Correction) { CList.push_back(Correction); while (CorrectionResults.size() > MaxTypoDistanceResultSets) - erase(llvm::prior(CorrectionResults.end())); + erase(std::prev(CorrectionResults.end())); } // Fill the supplied vector with the IdentifierInfo pointers for each piece of diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index 63b64801fe..9ee89a3169 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -203,8 +203,8 @@ DSAStackTy::DSAVarData DSAStackTy::getDSA(StackTy::reverse_iterator Iter, // TODO if (DVar.DKind == OMPD_task) { DSAVarData DVarTemp; - for (StackTy::reverse_iterator I = llvm::next(Iter), - EE = llvm::prior(Stack.rend()); + for (StackTy::reverse_iterator I = std::next(Iter), + EE = std::prev(Stack.rend()); I != EE; ++I) { // OpenMP [2.9.1.1, Data-sharing Attribute Rules for Variables Referenced // in a Construct, implicitly determined, p.6] @@ -231,7 +231,7 @@ DSAStackTy::DSAVarData DSAStackTy::getDSA(StackTy::reverse_iterator Iter, // For constructs other than task, if no default clause is present, these // variables inherit their data-sharing attributes from the enclosing // context. - return getDSA(llvm::next(Iter), D); + return getDSA(std::next(Iter), D); } void DSAStackTy::addDSA(VarDecl *D, DeclRefExpr *E, OpenMPClauseKind A) { @@ -286,7 +286,7 @@ DSAStackTy::DSAVarData DSAStackTy::getTopDSA(VarDecl *D) { // inside the construct are private. OpenMPDirectiveKind Kind = getCurrentDirective(); if (Kind != OMPD_parallel) { - if (isOpenMPLocal(D, llvm::next(Stack.rbegin())) && D->isLocalVarDecl() && + if (isOpenMPLocal(D, std::next(Stack.rbegin())) && D->isLocalVarDecl() && (D->getStorageClass() == SC_Auto || D->getStorageClass() == SC_None)) DVar.CKind = OMPC_private; @@ -351,13 +351,13 @@ DSAStackTy::DSAVarData DSAStackTy::getTopDSA(VarDecl *D) { } DSAStackTy::DSAVarData DSAStackTy::getImplicitDSA(VarDecl *D) { - return getDSA(llvm::next(Stack.rbegin()), D); + return getDSA(std::next(Stack.rbegin()), D); } DSAStackTy::DSAVarData DSAStackTy::hasDSA(VarDecl *D, OpenMPClauseKind CKind, OpenMPDirectiveKind DKind) { - for (StackTy::reverse_iterator I = llvm::next(Stack.rbegin()), - E = llvm::prior(Stack.rend()); + for (StackTy::reverse_iterator I = std::next(Stack.rbegin()), + E = std::prev(Stack.rend()); I != E; ++I) { if (DKind != OMPD_unknown && DKind != I->Directive) continue; DSAVarData DVar = getDSA(I, D); diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index f2c2ab1ae2..bf750a2227 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -265,7 +265,7 @@ static void removeEdgesToDefaultInitializers(PathPieces &Pieces) { I = Pieces.erase(I); continue; } else if (End && isa(End)) { - PathPieces::iterator Next = llvm::next(I); + PathPieces::iterator Next = std::next(I); if (Next != E) { if (PathDiagnosticControlFlowPiece *NextCF = dyn_cast(*Next)) { diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp index 3b4955755e..3bd06b4f09 100644 --- a/utils/TableGen/ClangAttrEmitter.cpp +++ b/utils/TableGen/ClangAttrEmitter.cpp @@ -1192,7 +1192,7 @@ SpellingNamesAreCommon(const std::vector& Spellings) { std::string FirstName = NormalizeNameForSpellingComparison( Spellings.front().name()); for (std::vector::const_iterator - I = llvm::next(Spellings.begin()), E = Spellings.end(); I != E; ++I) { + I = std::next(Spellings.begin()), E = Spellings.end(); I != E; ++I) { std::string Name = NormalizeNameForSpellingComparison(I->name()); if (Name != FirstName) return false;