From b9013351936d51424badfecbb3cd1e92c1209bb3 Mon Sep 17 00:00:00 2001 From: Alex Zinenko Date: Fri, 24 Jan 2020 11:27:17 +0100 Subject: [PATCH] [mlir] Use all_of instead of a manual loop in IntrinsicGen. NFC This was suggested in post-commit review of D72926. --- mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp b/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp index ca047ad7b21b..8a261e81cb31 100644 --- a/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp +++ b/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp @@ -117,11 +117,11 @@ public: /// Get the number of operands. unsigned getNumOperands() const { auto operands = record.getValueAsListOfDefs(fieldOperands); - for (const llvm::Record *r : operands) { - (void)r; - assert(r->isSubClassOf("LLVMType") && - "expected operands to be of LLVM type"); - } + assert(llvm::all_of(operands, + [](const llvm::Record *r) { + return r->isSubClassOf("LLVMType"); + }) && + "expected operands to be of LLVM type"); return operands.size(); }