diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index 38448a0825617..c0261c462b883 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -65,10 +65,10 @@ Parser::ParseObjCAtDirectives(ParsedAttributes &DeclAttrs, case tok::objc_implementation: break; default: - llvm::for_each(DeclAttrs, [this](const auto &Attr) { + for (const auto &Attr : DeclAttrs) { if (Attr.isGNUAttribute()) Diag(Tok.getLocation(), diag::err_objc_unexpected_attr); - }); + } } Decl *SingleDecl = nullptr; diff --git a/clang/lib/Sema/SemaPseudoObject.cpp b/clang/lib/Sema/SemaPseudoObject.cpp index 408f71044fa30..1ac895e4eb1c8 100644 --- a/clang/lib/Sema/SemaPseudoObject.cpp +++ b/clang/lib/Sema/SemaPseudoObject.cpp @@ -1451,7 +1451,8 @@ MSPropertyOpBuilder::getBaseMSProperty(MSPropertySubscriptExpr *E) { Expr *MSPropertyOpBuilder::rebuildAndCaptureObject(Expr *syntacticBase) { InstanceBase = capture(RefExpr->getBaseExpr()); - llvm::for_each(CallArgs, [this](Expr *&Arg) { Arg = capture(Arg); }); + for (Expr *&Arg : CallArgs) + Arg = capture(Arg); syntacticBase = Rebuilder(S, [=](Expr *, unsigned Idx) -> Expr * { switch (Idx) { case 0: diff --git a/clang/utils/TableGen/RISCVVEmitter.cpp b/clang/utils/TableGen/RISCVVEmitter.cpp index d2c3d70ac1f01..41025926058ed 100644 --- a/clang/utils/TableGen/RISCVVEmitter.cpp +++ b/clang/utils/TableGen/RISCVVEmitter.cpp @@ -264,13 +264,14 @@ void SemaSignatureTable::init(ArrayRef SemaRecords) { assert(!SemaRecords.empty()); - llvm::for_each(SemaRecords, [&](const SemaRecord &SR) { + for (const SemaRecord &SR : SemaRecords) { InsertToSignatureSet(SR.Prototype); InsertToSignatureSet(SR.Suffix); InsertToSignatureSet(SR.OverloadedSuffix); - }); + } - llvm::for_each(Signatures, [this](auto &Sig) { insert(Sig); }); + for (auto &Sig : Signatures) + insert(Sig); } void SemaSignatureTable::insert(ArrayRef Signature) {